File size: 170 Bytes
f39e411
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
export function asyncHandler(fn) {
  return async function (req, res, next) {
    try {
      await fn(req, res, next);
    } catch (err) {
      next(err);
    }
  };
}