Closed LukDrews closed 2 years ago
This question is more related to express itself. You would have to create an extra router at the common path and add the middleware to it. Then you have to mount the router to the app. And voila, all routes share the same middleware.
I know how I can add a middleware to all routes and how I can add one to just one route. But I want to add a middleware for all endpoints on a route by adding it to a common base path.
These are my endpoints:
I want to define a middleware for
server/*
only once and all child endpoints should use it. Is this possible?