Express/MongoDB backend with JWT auth, RBAC, S3 uploads, notifications, and scheduled jobs.
10 lines
159 B
JavaScript
10 lines
159 B
JavaScript
// /utils/catchAsync.js
|
|
|
|
const catchAsync = (fn) => {
|
|
return (req, res, next) => {
|
|
fn(req, res, next).catch(next);
|
|
};
|
|
};
|
|
|
|
module.exports = catchAsync;
|