- Install Docker
1.1 Clone repo
git clone https://github.com/dmusev/stocks-prices-api.git && cd ./stocks-prices-api1.2 Create .env file similar to .env.example
cp .env.example .env1.3 Provide the required environment variables.
- Populate them directly in the .env file
NODE_ENV=development
NODE_HOST=0.0.0.0
NODE_PORT=3000
CMC_API_KEY=bc317757-32d5-4735-919e-823bb96374c7
PROJECT_SHORT_NAME=stocksNB! This API key is for test purposes and has limited restrictions on 300 requests per day. You may register one at: CMC PRO
1.4 Verify all variables are populated in the docker-compose file:
docker-compose config1.5 Build the container
docker-compose build --no-cache server1.6 Run the container
docker-compose up serverNB! Make sure you've set a free port within .env file
1.7 You should see a successful message
stocks-server | [nodemon] starting `babel-node ./server.js`
stocks-server | 🚀 Server ready at port 30002.1 Fetch currencies and information about them
curl --location --request GET 'localhost:3000/stocks/cryptocurrencies'2.2 Fetch specific currency information
curl --location --request GET 'localhost:3000/stocks/cryptocurrencies/1027'