Created
April 23, 2017 17:30
-
-
Save Abazhenov/e5facb8af95bae0b65607c0e028b6eb8 to your computer and use it in GitHub Desktop.
This file contains 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
const asyncMiddleware = fn => | |
(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