Files
OpenAuth_server/Backend/src/helper/promiseMiddleware.ts
Fabian Stamm 0453e461c9 Restructuring the Project
Updating dependencies
2023-04-07 19:54:47 +02:00

8 lines
265 B
TypeScript

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);
};