mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-26 19:54:25 +00:00
0a12c47b35
Move chat service to ES modules GitOrigin-RevId: c08ae8328b8f3b539e6cfe052834b84bb3756330
10 lines
240 B
JavaScript
10 lines
240 B
JavaScript
/**
|
|
* Transform an async function into an Express middleware
|
|
*
|
|
* Any error will be passed to the error middlewares via `next()`
|
|
*/
|
|
export function expressify(fn) {
|
|
return (req, res, next) => {
|
|
fn(req, res, next).catch(next)
|
|
}
|
|
}
|