When trying to access a route param in the API part (e.g. the id from server/api/[id]/test.get.ts) in the server middleware (e.g. server/middleware/console.ts), the params are always undefined, although they are then present in the actual event handler of the route.
The nitro middleware has now knowledge about "how the route resolves" and possible params. You could use a wrapped handler for the routes needing some functionality (more info in the docs).
Environment
Reproduction
https://stackblitz.com/edit/github-nyobao-hs48va?file=server%2Fmiddleware%2Fconsole.ts
Describe the bug
When trying to access a route param in the API part (e.g. the
id
fromserver/api/[id]/test.get.ts
) in the server middleware (e.g.server/middleware/console.ts
), the params are always undefined, although they are then present in the actual event handler of the route.Additional context
No response
Logs
No response