Adonis Route group in group

I have this on my first Project

const apiv1Group = (group) => {
  group.prefix('api/v1').as('api.v1')
  return group
}

apiv1Group(
  Route.group(() => {
    require('./training')
  }).namespace('Training').prefix('train').as('training')
)

I can get adonis route:list with the code above.

in my second project, i have wrote identically the code above, but it’s give me an error said Route.group(...).namespace(...).prefix(...).as(...) is not a function

am i missing some steps ?

Thanks

1 Like