fase(7): api server refactor with composition root
This commit is contained in:
9
dist/api/middleware/notFound.js
vendored
Normal file
9
dist/api/middleware/notFound.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.notFoundMiddleware = notFoundMiddleware;
|
||||
function notFoundMiddleware(req, res) {
|
||||
res.status(404).json({
|
||||
error: `Route ${req.method} ${req.path} not found`,
|
||||
code: 'NOT_FOUND',
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user