UNPKG

techdadi-express-starter-ts

Version:

CLI for creating a new Express TypeScript starter project

8 lines (6 loc) 237 B
import { Request, Response, NextFunction } from 'express'; export default function catchAsync(fn: Function) { return (req: Request, res: Response, next: NextFunction) => { fn(req, res, next).catch((err: any) => next(err)); }; }