Closed achyut-tokekar closed 3 months ago
Duplicate routes are usually a sign of incorrect or buggy behavior as the user is free to route the request to any upstream functions or logic from the sole route handler.
If you would like to disable this behavior, you can fork and remove the following snippet: https://github.com/kartikk221/hyper-express/blob/master/src/components/Server.js#L370-L375
@kartikk221 If while creating server we could pass an option to allow duplicate routes?
I was implementing hyper-express in nestjs and got stuck in an issue where if I was importing pino-logger, I'm getting Error: HyperExpress: Failed to create route as duplicate routes are not allowed. Ensure that you do not have any routers or routes that try to handle requests with the same pattern.
After digging further got to know that pino might be internally doing something which is causing all routes to get registered twice, so wanted to know why this restriction is added and how to resolve it?