mirror of
https://github.com/fosrl/pangolin.git
synced 2025-06-24 14:18:55 +02:00
15 lines
426 B
TypeScript
15 lines
426 B
TypeScript
|
import { NextFunction, Request, Response } from "express";
|
||
|
import createHttpError from "http-errors";
|
||
|
import HttpCode from "@server/types/HttpCode";
|
||
|
|
||
|
export function notFoundMiddleware(
|
||
|
req: Request,
|
||
|
res: Response,
|
||
|
next: NextFunction,
|
||
|
) {
|
||
|
const message = `The requests url is not found - ${req.originalUrl}`;
|
||
|
return next(createHttpError(HttpCode.NOT_FOUND, message));
|
||
|
}
|
||
|
|
||
|
export default notFoundMiddleware;
|