This is a skeleton service that uses NodeJS 8 and Express. It contains the following:
- Yarn for dependency management
- Jest for testing + coverage (must be > 80%)
- Supertest for testing the express server
- JSON configs for multi-environment setup
- EditorConfig for code formatting
- Swagger for API docs
- Pino for server logging and HTTP logs
- Dockerfile and Docker Compose to run the service
In order to build the project, you will have to install the following:
yarn install
docker build -t andspuds/customer-api .
Development:
yarn serve
Production:
yarn forever
Environment variables:
- ENVIRONMENT = Spring Profile to use for configurations default, dev or prod (required)
docker-compose up --build
If you need to change any of the environment variables, please use the .env
file.
To run ESLint, execute:
yarn lint
To run the unit and integration tests, execute:
yarn test
Once you run the application, the documentation of the API can be found at: http://localhost:8080/swagger