a little error handling

This commit is contained in:
Martin Donnelly 2018-06-14 00:38:37 +01:00
parent 3ec2ee2dfd
commit 623e42e6d7

View File

@ -32,7 +32,7 @@ const ips = ['212.71.255.44', '82.35.75.161'];
const complexUrls = new Map();
// app.use(ipfilter(ips, { 'mode': 'allow' }));
app.use(ipfilter(ips, { 'mode': 'allow' }));
app.use((err, req, res, _next) => {
console.log('Error handler', err);
@ -210,8 +210,7 @@ function getUrl (req, res) {
});
}
// app.get('/:encoded_id', cache('15 minutes'), getUrl);
app.get('/:encoded_id', getUrl);
app.get('/:encoded_id', cache('15 minutes'), getUrl);
process.on('uncaughtException', function (err) {
console.error(err);