Create handler for api requests

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-02-19 21:43:12 +04:00
parent 85035052eb
commit e46bd02f8c
+11
View File
@@ -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