games-express-api/middleware/async.js

5 lines
126 B
JavaScript
Raw Normal View History

2024-09-12 15:48:27 -04:00
const asyncHandler = fn => (req, res, next) =>
Promise.resolve(fn(req, res, next)).catch(next)
export default asyncHandler