mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-26 06:46:40 +00:00
started integrating auth with lucia
This commit is contained in:
14
server/middlewares/notFound.ts
Normal file
14
server/middlewares/notFound.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user