Closed alaughlin closed 1 year ago
Is there a way to define a custom middleware decorator so that it could take more than just the req, res, and next function?
Ideally I'd like to invoke a custom middleware on a per-route basis like so:
MyMiddleware(SomeArgument) Get() async get() {...}
and MyMiddleware would be defined in a way that lets me access the SomeArgument that was passed in along with the req, res, etc
MyMiddleware
SomeArgument
I should have checked the discussions, I found the answer here https://github.com/instantcommerce/next-api-decorators/discussions/361
Is there a way to define a custom middleware decorator so that it could take more than just the req, res, and next function?
Ideally I'd like to invoke a custom middleware on a per-route basis like so:
and
MyMiddleware
would be defined in a way that lets me access theSomeArgument
that was passed in along with the req, res, etc