Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run middleware also after the handler #609

Open
IuliiaBondarieva opened this issue Jun 6, 2023 · 0 comments
Open

Run middleware also after the handler #609

IuliiaBondarieva opened this issue Jun 6, 2023 · 0 comments

Comments

@IuliiaBondarieva
Copy link

Is your feature request related to a problem? Please describe.
I would like to run middleware after the handler was executed.

Describe the solution you'd like
It will be great if I could run middleware in @UseMiddleware also after the handler was executed.

Describe alternatives you've considered
I saw this feature in next-api-middleware library but I would like to have it in next-api-decorators library as it already provides almost all features that we need.

Additional context
They implemented "winding and unwinding stack" concept, and the execution of the middleware code before or after the handler execution depends only on the implementation of the middleware.

To execute code after handler execution finished you just add await next() as first in your middleware.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant