mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-12 03:55:28 -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
|