Read the requirements below before running the application.
Made with:
After cloning the repo, cd
into the directory. Create a file named .env
and insert the following variables:
COINMARKETCAP_API_KEY=<your API key here>
CRYPT_API_DEFAULT_CURRENCY=BRL
COINMARKETCAP_API_KEY
is the CoinMarketCap API Key.
CRYPT_API_DEFAULT_CURRENCY
should be BRL
or USD
.
Run rails db:migrate
and then rails server -b 0.0.0.0
.
There are two routes defined:
- GET /api/v1/crypto_coins
- PUT /api/v1/crypto_coins
The GET
request returns a JSON with the list of CryptoCoins.
The PUT
request updates the list of CryptoCoins, and takes an optional currency
parameter.