Replies: 1 comment
-
|
Oh, I think I got it. Define multiple routers: const publicRouter = new Router()
publicRouter
.get(...)
const serviceRouter = new Router()
serviceRouter
.use(protectService)
.post(...)
.post(...)
app.use(publicRouter.routes())
app.use(serviceRouter.routes()) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I tried to understand the code in router.ts but I still could't figure out how to use a middleware for only a set of routes, however this did't not work and I also could not find any documentation how I could do it.
Is this even possible?
Or is the only way to go:
Beta Was this translation helpful? Give feedback.
All reactions