-
Clone the repository:
git clone https://github.com/dakhanbaev/currency_conversion.git
-
Navigate to the project directory:
cd currency_conversion
-
Create a
.env
file in the root of the project and set the required environment variables. You can use the providedenv-file
as a template.API_TOKEN=your-exchange-api-token
to get API_TOKEN visit : ExchangeRateAPI
-
Build and run the Docker containers:
make run
This will build the project and start the Docker containers. Other container commands in Makfile
-
API is built using FastAPI.
-
Get Last Update
curl http://localhost:8000/api/concurrency_conversion/last_update/{currency_name}
-
Update Currency
curl http://localhost:8000/api/concurrency_conversion/update/{currency_name}
-
Convert Currency
curl -X POST -H "Content-Type: application/json" -d '{"source_currency": "USD", "target_currency": "EUR", "amount": 100}' http://localhost:8000/api/concurrency_conversion/convert
docker exec -it api /bin/bash
pytest tests/