@les-roberts/api_gateway_generator
v1.0.7
Published
This is a simple cli to generate your project and generating your routes to perfectly communicate with the api-gateway
Downloads
2
Readme
Initialise your project and add some routes
This is a simple cli to generate your project and generating your routes to perfectly communicate with the api-gateway
Installation
First install the dependencie
$ npm i -g @les-roberts/api_gateway_generator
Install all dependencies
$ npm i
Usage
$ api_gateway_generator <command>
First generate the project with :
$ api_gateway_generator init
√ Enter server port · 5000
Loaded templates: PATH_TO_NODE_MODULE\@les-roberts\api_gateway_generator\_templates
added: src/config/routerConfig.ts
added: src/main.ts
added: package.json
added: src/config/serverConfig.ts
added: tsconfig.json
And then to generate your route :
$ api_gateway_generator route
√ Enter the name of the Route you want to create · user
√ Type host (you can add more later in routerConfig.ts) · http://localhost:3009
√ What strategy do you want to use ? · round-robin
Loaded templates: PATH_TO_NODE_MODULE\@les-roberts\api_gateway_generator\_templates
inject: src/config/routerConfig.ts
You can launch your app with :
$ npm run start
> [email protected] start PATH_TO_PROJECT/PROJECT
> ts-node src/main.ts
App listenning on port : 8000