I have an express server and I am trying to render my readme at the '/' endpoint. I am looking to simply display the file contents (like github does). I cannot find a straightforward method, i guess to render this as html? Express doesn't seem to support md files.
Currently, I am having issues using the following:
const readme = require('../README.md');
app.get('/', function(req, res) {
res.send(readme)
});
With the error:
README.md:1
# Express API
^
SyntaxError: Invalid or unexpected token
Which is pointing at the first line of the file.