- Clone repo
- Go to Alpha Vantage docs to generate free API_KEY
- Create
.env
file at the root of project and put the following contents inside:
VANTAGE_KEY=<your_api_key>
cargo build -r
./target/release/exchange_rates -h
./target/release/exchange_rates -l
./target/release/exchange_rates -t USD -f PLN -a 7.50
docker build . -t exchange
docker run exchange -h
docker run exchange -l
docker run exchange -t USD -f PLN -a 7.50
Exchange from Polish Zloty into United States Dollar:
Exchange rate: 0.25090000,
7PLN = 1.7563USD
Usage: exchange_rates [OPTIONS]
Options:
-l, --list Prints a list of available country codes with their corresponding name
-t, --to <TO> The destination currency for the exchange rate. For example: `--to=USD`
-f, --from <FROM> The currency you would like to get the exchange rate for. For example: `--from=PLN`
-a, --amount <AMOUNT> Amount you would like to convert. For example: `--amount=7.52`
-h, --help Print help
-V, --version Print version
Unit tests run automatically during building a docker image. You can also run them locally using cargo test