Route gets double slash when try to define root level routes; `//users` instead of `/users`
See original GitHub issueIs there any plan to support root level routing? It seems not at the moment.
I was thinking of separating normal user namespace and admin user space like following, but got result of having //users
as result where I expected to have /users
. This //users
is really accessible by //users
and doesn’t treated as /users
.
It would be nice if I could manage all routes including root level in this route configuration.
route setting code
export const routes: Routes = [
{
path: '',
children: [
UserModule,
],
},
{
path: 'admin',
children: [
AdminUserModule,
],
},
]
part of log output
[RoutesResolver] UserController {//users}
[RoutesResolver] AdminUserController {/admin/users}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Route gets double slash when try to define root level routes
Route gets double slash when try to define root level routes; `//users` instead of `/users`
Read more >django-channels: No route found for path - Stack Overflow
routing routes file solved the problem, I guess it was being counted a duplicate slash in the URL of that socket. For instance,...
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 >Handling trailing slashes properly with mounted routes #869
I started by trying to give an empty route, i.e. Route('', users, methods=['GET', 'POST']) , but that simply does not work: AssertionError: ...
Read more >Router tutorial: tour of heroes - Angular
In this tutorial, you build upon a basic router configuration to explore features such as child routes, route parameters, lazy load NgModules, guard...
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 Free
Top 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
So we should mark this as solved now.
So, anyone has this issue, Please upgrade to Nestjs v8.
I think so.
Just find the line that has this bug (in v7): https://github.com/nestjs/nest/blob/98eee426df5514b2194f50c9a81d8d9ac1540b55/packages/core/router/router-explorer.ts#L100