mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-01 17:29:56 -05:00
11 lines
188 B
JavaScript
11 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
|