Create handler for api requests
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
function w(handler) {
|
||||
return async (request, response, next) => {
|
||||
try {
|
||||
await handler(request, response, next)
|
||||
} catch (error) {
|
||||
next(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = w
|
||||
Reference in New Issue
Block a user