- Crypto currency app using React
- Note: to open web links in a new window use: ctrl+click on link
- Lists prices of cryptocurrencies against the US dollar - setup can be changed via http request.
- Node.js v14 javascript runtime using the Chrome V8 engine.
- React v17 Javascript library.
- Axios v0.26.1 promise based HTTP client used to get crypto prices from axternal API.
- API does not require an API key.
npm start
Runs the app in the development mode. Open http://localhost:3000 to view it in the browser.npm run build
Builds the app for production to thebuild
folder. It correctly bundles React in production mode and optimizes the build for the best performance. The build is minified and the filenames include the hashes.
- extract of
App.js
- axios http asynchronous call to cryptocurrency API.
/*
function will be carried out once app loads
axios is promise-based so then function used
cryptocompare returns price of 3 bitcoins compared to the US $.
*/
componentDidMount() {
const fsymsList = 'BTC,XRP,BCH,ETH,ZEC,EOS,XMR,ETC,LTC,DASH,QTUM,NEO,XLM,TRX,ADA,BTS,USDT,XUC,PAX,IOT'
axios
.get('https://min-api.cryptocompare.com/data/pricemulti?fsyms=' + fsymsList + '&tsyms=USD')
.then(res => {
const cryptos = res.data;
console.log(cryptos);
this.setState({cryptos: cryptos});
});
}
- Status: Working. Deployed to Guthub-Pages
- To-Do: Nothing
- Gary Simon of Coursetro: React CryptoCurrency Tutorial - Display Exchange Data with an API sept 2017
- CryptoCompare API for cryptocurrency prices.
- This project is licensed under the terms of the MIT license.
- Repo created by ABateman, email: gomezbateman@yahoo.com