games-express-api/middleware/async.js

5 lines
126 B
JavaScript

const asyncHandler = fn => (req, res, next) =>
Promise.resolve(fn(req, res, next)).catch(next)
export default asyncHandler