mirror of
https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-service.git
synced 2026-09-21 16:52:03 -07:00
Merge pull request #5 from alansikora/improvement/last-handler
Last handler
This commit is contained in:
@@ -19,7 +19,11 @@ exports = module.exports = function initModules(app) {
|
||||
handlers = []
|
||||
} = config
|
||||
|
||||
instance[method.toLowerCase()](route, ...handlers)
|
||||
const lastHandler = handlers.pop()
|
||||
|
||||
instance[method.toLowerCase()](route, ...handlers, async function(ctx) {
|
||||
return await lastHandler(ctx)
|
||||
})
|
||||
|
||||
app
|
||||
.use(instance.routes())
|
||||
|
||||
@@ -134,7 +134,7 @@ export async function getUser(ctx, next) {
|
||||
ctx.throw(500)
|
||||
}
|
||||
|
||||
next()
|
||||
if(next) return next()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user