Created
March 23, 2018 13:57
-
-
Save Cyberuben/2ec0cfe43e3132c1c45f04736d883fb2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// middleware/wrap.js | |
module.exports = (fn) => { | |
return (req, res, next) => { | |
Promise.resolve(fn(req, res, next)).catch(next); | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment