-// Catch 404 and forward to error handler
-app.use(function (req, res, next) {
- const err = new Error('Not Found')
- err['status'] = HttpStatusCode.NOT_FOUND_404
- next(err)
+// Catch unmatched routes
+app.use((req, res: express.Response) => {
+ res.status(HttpStatusCode.NOT_FOUND_404).end()