little-library/routes/get_about.js

12 lines
436 B
JavaScript
Raw Normal View History

2019-01-10 23:20:48 +01:00
module.exports = function (app) {
app.server.get('/about', (req, res) => {
const resourcePath = (req.url.substr(-1) === '/' ? '../' : './');
2019-01-10 23:31:08 +01:00
const body = app.templater.fill('./templates/pages/about.html', { resourcePath });
const html = app.templater.fill('./templates/htmlContainer.html', { title: 'About', body });
2019-01-10 23:20:48 +01:00
if (html) {
res.send(html);
} else {
res.send('Something went wrong!');
}
});
}