Restructuring the Project
Updating dependencies
This commit is contained in:
7
Backend/src/helper/promiseMiddleware.ts
Normal file
7
Backend/src/helper/promiseMiddleware.ts
Normal file
@ -0,0 +1,7 @@
|
||||
import { Request, Response, NextFunction } from "express";
|
||||
|
||||
export default (
|
||||
fn: (req: Request, res: Response, next: NextFunction) => Promise<any>
|
||||
) => (req: Request, res: Response, next: NextFunction) => {
|
||||
Promise.resolve(fn(req, res, next)).catch(next);
|
||||
};
|
Reference in New Issue
Block a user