notFoundHandler
function notFoundHandler(req: Object, res: Object, next: function)
Sends a 404 response when no route matches the request.
See the official express package documentation for more details:
Returns: void
PARAMETER | TYPE | OPTIONAL | DEFAULT | DESCRIPTION |
---|---|---|---|---|
req | Object | Express request object. | ||
res | Object | Express response object. | ||
next | function | Express next function. |
See:
const app = express();
app.use(notFoundHandler);