Skip to content

Commit

Permalink
Merge pull request #29 from zooniverse/markdownz
Browse files Browse the repository at this point in the history
Upgrade to Markdownz
  • Loading branch information
eatyourgreens authored Nov 6, 2023
2 parents e5450fb + 1fb7a55 commit 12d475c
Show file tree
Hide file tree
Showing 3 changed files with 1,939 additions and 60 deletions.
12 changes: 9 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var express = require('express');
var bodyParser = require('body-parser');
const { utils } = require('markdownz');
var morgan = require('morgan');
var cors = require('./lib/cors');
var Markdown = require('./lib/markdown');

var app = express()
.use(cors)
Expand All @@ -14,8 +14,14 @@ app.post('/html', function(req, res) {
params = req.body;
res.setHeader('Content-Type', 'text/html');
res.statusCode = 200;
markdown = new Markdown(params.markdown, params.project);
res.end('<div>' + markdown.html() + '</div>');
html = utils.getHtml({
baseURI: 'https://www.zooniverse.org',
content: params.markdown,
project: {
slug: params.project
}
})
res.end('<div>' + html + '</div>');
});

app.get('/', function(req, res) {
Expand Down
Loading

0 comments on commit 12d475c

Please sign in to comment.