This project uses the following environment variables:
Name | Description | Default Value |
---|---|---|
PORT | Express Server Running Port | 4000 |
GOLD_PRICE_BASE_URL | Base URL for Gold Price API | http://api.nbp.pl/api/cenyzlota/ |
- Install Node.js version 16+
- Insatll dependencies
npm install
- Run production script
npm run production
Navigate to http://localhost:4000/api/v1/calculate/maxProfit
Login to Docker.
docker login
Build Docker Image.
docker build . -t nbp-api-task
Run Docker Image in a container.
docker run -p 4000:4000 -d nbp-api-task
Navigate to http://localhost:4000/api/v1/calculate/maxProfit
Make sure port 4000 is not utilized on any other process