changed the url to /feed/ and reject everything else

This commit is contained in:
Martin Donnelly 2018-06-13 22:24:01 +01:00
parent 0a587fb804
commit 708034e143

View File

@ -179,7 +179,11 @@ app.get('/feed/:encoded_id', getUrl);
// app.use(notFoundHandler);
// Final middleware is our catch-all error handler
app.use(defaultErrorHandler);
app.get('*', function(req, res, next) {
const err = new Error(`${req.ip} tried to access /Forbidden`); // Sets error message, includes the requester's ip address!
err.statusCode = 403;
next(err);
});
const server = app.listen(port, () => {
logger.info(`Server listening on port ${port}`);