nestjsx / nest-router

Router Module For Nestjs Framework 🚦 🚀
MIT License
619 stars 36 forks source link

How to use versioning in v7? #165

Open shobhitmshr002 opened 2 years ago

shobhitmshr002 commented 2 years ago

I want to use something like @version in v7

shekohex commented 2 years ago

I guess Nest already support Versioning. So you should use that, And If you are looking to use the nest-router as versioning solution, then you can do that too by creating a top level router with a prefix/path of v1 or v2 ..etc and based on that you can use two modules for each one of these, here is an example in code for better understanding:


const routes: Routes = [
    {
      path: '/v1',
      module: UsersV1Module,
      children: [
        ...
    ],
    },
    {
      path: '/v2',
      module: UsersV2Module,
      children: [
        ...
    ],
    },
  ];