added server caching

This commit is contained in:
Martin Donnelly 2017-09-11 15:30:11 +01:00
parent 51dc4a5beb
commit 1799d8a72f

View File

@ -21,11 +21,6 @@ const cache = apicache.middleware;
app.use(cache('5 minutes'));
function bob(req, res) {
logger.debug(req.params);
res.sendStatus(200);
}
function getUrl (req, res) {
const theUrl = req.params.encoded_id;
logger.debug('Want', theUrl);
@ -79,19 +74,6 @@ function getUrl (req, res) {
logger.error(e);
});
}
/* http.request(options).on('response', response => {
let data = '';
response.on('data', chunk => {
data += chunk;
});
response.on('end', () => {
callback(data);
});
response.on('error', e => {
logger.error(e);
});
}).end();*/
}
catch (e) {
logger.error(e);