mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -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
|