generate api from swagger nx
*** This example is nestjs + react and library directory on folder name generations
!!
- create service
- create schema
- create dto
- install lib
axios
- can you set base url service
NX_URI_SERVICE_API
(defaulthttp://localhost:8000
) - can you set directory by key
NX_DIRECTORY_GENERATE_API
(defaultlibs/generators-api
) - implement api and add tag swagger
Generate
or set key envNX_KEY_GENERATE
on route - run generate script
- set nx export lib on
tasconfig.basse.json (paths)
- get function api on client by directory
(libs/generators-api)
- use
subscribe
response data
*** if error a babel you can use config nx babel.config.json "presets": ["@nrwl/web/babel"]
. you can watch api json from http://localhost/api-json
and you can watch all api from http://localhost/api
$npm run gen:api
- axios
- swagger-typescript-api
- fs
- path
- rimraf
- dotenv
- swagger
- nx