Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested modules does not retain prefixes. #81

Open
zackarychapple opened this issue Apr 21, 2020 · 2 comments
Open

Nested modules does not retain prefixes. #81

zackarychapple opened this issue Apr 21, 2020 · 2 comments

Comments

@zackarychapple
Copy link

zackarychapple commented Apr 21, 2020

Really excited to see this project. Started using it right away and was pleased to see how easy it works out of the box. However I'm trying to build nested routes that are two (possibly more) levels deep.

const routes: Routes = [
  {
    path: '/myPath',
    children: [
      {path: '', module: MyApiModule}
    ]
  }
]

MyApiModule has its own nested routes

const routes: Routes = [
  {
    path: '/v1',
    children: [
      {path: '/summary', module: SummaryModule}
    ]
  }
]

When I try to hit /api/myPath/v1/summary I get a 404 however when I hit /api/v1/summary I get the response I'm expecting. I would expect that having a child module that also has children would flatten this way.

@Mati365
Copy link

Mati365 commented Nov 29, 2020

Any changes? Problem still occurs

@shekohex
Copy link
Member

Could you try this instead?

const routes: Routes = [
  {
    path: '/myPath',
    children: [MyApiModule]
  }
]
const routes: Routes = [
  {
    path: '/v1',
    children: [
      {path: '/summary', module: SummaryModule}
    ]
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants