Handle logic for request pre-processing & post-processing #63055
Unanswered
developershyam
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In NextJs unlike other frameworks it doesn't provide filter chain or request pre-processing or post processing.
This could be a common need for any node project or some library developers to have their logic to be executed before and after actual call delegated to API endpoint / Web pages.
NextJS Middleware provides a way with limited feature(Edge Runtime) for request pre-processing but that can't be used for request post-processing.
Above mentioned scenario can be handled with custom express server which provides handle() & next() function to control the flow.
If I go with custom server on my own infra, am I losing any optimization or performance stuff?
Any idea how to deal with it next server?
Beta Was this translation helpful? Give feedback.
All reactions