mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-24 21:12:38 -04:00
ee85d948e2
GitOrigin-RevId: ef2ef77e26df59d1af3df6dc664e284d3c70102d
10 lines
188 B
JavaScript
10 lines
188 B
JavaScript
/**
|
|
* Turn an async function into an Express middleware
|
|
*/
|
|
function expressify(fn) {
|
|
return (req, res, next) => {
|
|
fn(req, res, next).catch(next)
|
|
}
|
|
}
|
|
|
|
module.exports = expressify
|