This project allows you to get the exchange rate of any listed Coingecko coins vs another supported currency (Crypto or FIAT)
git clone https://github.com/Fedevs/crypto-converter-app.git
git clone https://github.com/Fedevs/crypto-converter-app-front.git
https://github.com/Fedevs/krypto-ledgers-test-front
cd crypto-converter-app
npm install
npm run start
npm run test
After running the server, you can make request to the following:
GET /coins
- No parameters needed
- Response: An Array of Objects
- e.g. [{id:'bitcoin', symbol:'btc', name:'bitcoin'}, {id:'ethereum', symbol:'eth', name:'ethereum'}, ...]
GET /currencies
- No parameters needed
- Response: An Array of Strings. e.g. ['usd', 'clp', 'ars', ...]
GET /convert
- Parameters: {ids: String, vs_currencies: String, amount: Number} - amount is optional but it is 0 by default.
- e.g. {ids: 'bitcoin', vs_currencies: 'usd', amount: 7}
- Response: A Number
- I used Coingecko API client (https://github.com/miscavage/CoinGecko-API)
- In src/app.js is the server configuration
- In src/routes.js you will find the API client requests
- Finally, there are some test in test/app.spec.js
MIT