overleaf/services/history-v1/api/controllers/expressify.js

11 lines
188 B
JavaScript
Raw Normal View History

/**
* Turn an async function into an Express middleware
*/
function expressify(fn) {
return (req, res, next) => {
fn(req, res, next).catch(next)
}
}
module.exports = expressify