Swagger ExpressJS Scaffold
This is an API scaffold which provides a design first approach to API development built on Swagger and ExpressJS.
Prerequisites
- Docker
- Node environment
- yarn
- Setup node dependencies from the api folder:
yarn install
Editing the API Contract
See Editing the API
Running
From the api directory of the project:
Start the application (from this api folder):
yarn start
Get API status
curl localhost:10010/v1/status
Run specs
yarn test
Run integration tests
yarn integration-test
Linting the code
Runs static analysis on the code to identify problematic patterns or code that doesn’t adhere to certain style guidelines.
Linting is there to guide you. If you feel yourself questioning rules then step back and think for a moment. These rules where created by people with extensive node experience so rather than suppressing the rule understand its purpose.
yarn lint
Run vulnerabilities check
Use nsp to run a vulnerabilities check on the projects dependencies.
yarn nsp
With Docker
You can alternatively run it all in docker by following these instructions