little-library/routes/get_give.js

10 lines
438 B
JavaScript
Raw Permalink Normal View History

2019-01-10 23:20:48 +01:00
module.exports = function (app) {
app.server.get('/give', (req, res) => {
const resourcePath = (req.url.substr(-1) === '/' ? '../' : './');
2019-01-10 23:31:08 +01:00
let body = app.templater.fill('./templates/pages/uploadForm.html', { resourcePath });
2019-01-10 23:20:48 +01:00
body = app.replaceBodyWithTooManyBooksWarning(body);
2019-01-10 23:31:08 +01:00
const html = app.templater.fill('./templates/htmlContainer.html', { title: 'Give a Book', resourcePath, body });
2019-01-10 23:20:48 +01:00
res.send(html);
});
}