404 error middleware

pull/1/head
sundowndev 2018-11-12 18:19:58 +01:00
parent f87986fd69
commit 1b7da6d9b2
1 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,10 @@ const port = process.env.PORT || 8080; // set our port
app.use('/', routes);
app.use(function(req, res) {
res.status(404).json({ message: 'Resource not found.' });
});
// Start the server
app.listen(port);
console.log('Server started on port ' + port);