-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Custom middleware after nextjs RequestHandler #7665
Comments
Maybe, instead of a middleware, you can use the |
Next.js does not provide a middleware, it ends the request when you call handle. So like @Janpot is saying you'll probably want to add on finish or similar. |
@timneutkens could you expand why adding a Middleware concept would be a bad idea for this framework ? |
@timneutkens NextJS is great, I think it could be Amazing if I knew what is the correct way to open a dialogue about features such as middlewares or at least understanding why it does not fit the ZEIT's vision. In the meantime, this is how to work around it as @Janpot kindly advised.
|
There already was an open RFC before this issue was posted: #7208 |
@timneutkens @sesteva would this help? https://github.com/oslabs-beta/connext-js I'd still like to see middleware for my pages, but this for API Routes seems feasible |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Feature request
Related to #6290
We need to run some logic after every route is handled.
Is your feature request related to a problem? Please describe.
We have a Prometheus client where we report performance metrics.
"handleRequest" does not call next and therefore our code is never invoked.
Custom Server Example
Describe the solution you'd like
handleRequest should call next
This would solve #7499 as well allowing people to add middlewares
Describe alternatives you've considered
I've not found a workaround
The text was updated successfully, but these errors were encountered: