mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 09:33:33 -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
|