mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -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
|