`app.showRoutes()` has duplicate routes when middleware is used
See original GitHub issueExample code
app.get("/a", someMiddleWare, (c) => {
new Response("a");
})
app.showRoutes();
app.showRoutes() outputs:
GET /a
GET /a
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
laravel - Resolve duplicate routes based on middleware group
In web.php I have two middleware groups for two user roles - admins and non_admins : ... My guess: Laravel sees the two...
Read more >Detecting duplicate routes in ASP.NET Core
In this post I show how you can use a unit test to identify duplicate routes that would fail at runtime.
Read more >Routing - Laravel - The PHP Framework For Web Artisans
The routes in routes/api.php are stateless and are assigned the api middleware group. For most applications, you will begin by defining routes in...
Read more >FAQ: Middleware - Route-Level app.use() - Multiple Paths
This community-built FAQ covers the “Route-Level app.use() - Multiple Paths” exercise from the lesson “Middleware”. Paths and Courses
Read more >Routing in ASP.NET Core - Microsoft Learn
Routing is responsible for matching incoming HTTP requests and dispatching those requests to the app's executable endpoints.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes. But I don’t want to give the options to developers for the
showRoutes
to make this simple. And it may make the code verbose mentioned above. In this case, the problem is the developer may feel, “Is this bug?”.For example, there could be a more clear way to show the routes, such as changing the color, numbering, and so on. However, we don’t know the best way.
Yes, of course, I also want to do that, but I could not implement it like that, I think there is no way:(