1.0.3 • Published 4 years ago

nestjs-route-exporter v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Description

Nest route exporter, exports application routes with developer friendly interface for consuming them on FE apps or somewhere else.

Installation

$ npm i --save nestjs-route-exporter
$ yarn add nestjs-route-exporter --save

Note!

Before generating routes modify tsconfig.json file to not watch exported routes directory because you will end up in recursive compilation:

  ...
  
  "include": [
    "./src/**/*"
  ],

  "exclude": ["node_modules", "dist", "routes/**/*"]

Generating typescript routes

async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule);
  
  // Generate typescript routes file
  routeExporter(app, 'http://localhost:3001', './routes', 'index.ts'); // Will generate index.ts in root/routes dir
}

bootstrap();
  • If you have Header controller in your Nest application output will be generated in root/routes/index.ts file

Typescript

Generating javascript routes

async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule);
  
  // Generate typescript routes file
  routeExporter(app, 'http://localhost:3001', './routes', 'index.js'); // Will generate index.js in root/routes dir
}

bootstrap();
  • If you have Header controller in your Nest application output will be generated in root/routes/index.js file

Javascript

Support

Nest route exporter is an MIT-licensed open source project.

Stay in touch

License

Nest route exporter is MIT licensed.

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago