question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Route gets double slash when try to define root level routes; `//users` instead of `/users`

See original GitHub issue

Is 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:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shekohexcommented, Sep 7, 2021

So we should mark this as solved now.

So, anyone has this issue, Please upgrade to Nestjs v8.

1reaction
micaleviskcommented, Sep 7, 2021
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found