27
loading...
This website collects cookies to deliver better user experience
https://code.visualstudio.com/download
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
nvm --version
nvm install 12
nvm use 12
node -v
npx -v
npx create-react-app my-app
cd mp-app
npm start
https://api.coindesk.com/v1/bpi/currentprice.json
{
“time”:{
“updated”:”Jul 4, 2021 17:55:00 UTC”,
“updatedISO”:”2021–07–04T17:55:00+00:00",
“updateduk”:”Jul 4, 2021 at 18:55 BST”
},
“disclaimer”:”This data was produced from the CoinDesk Bitcoin Price Index (USD). Non-USD currency data converted using hourly conversion rate from openexchangerates.org”,
“chartName”:”Bitcoin”,
“bpi”:{
“USD”:{
“code”:”USD”,
“symbol”:”$”,
“rate”:”35,583.4383",
“description”:”United States Dollar”,
“rate_float”:35583.4383
},
“GBP”:{
“code”:”GBP”,
“symbol”:”£”,
“rate”:”25,743.1231",
“description”:”British Pound Sterling”,
“rate_float”:25743.1231
},
“EUR”:{
“code”:”EUR”,
“symbol”:”€”,
“rate”:”29,990.2556",
“description”:”Euro”,
“rate_float”:29990.2556
}
}
}
componentDidMount() {
document.title = “Bitcoin Prices”; fetch(‘https://api.coindesk.com/v1/bpi/currentprice.json')
.then(results => { return results.json(); })
.then(data => {
const bpi = get(data, ‘bpi’, {});
const time = get(data, ‘time’, {})
this.setState({ bpi: bpi,
time: time });
});
}
fetch(‘https://api.coindesk.com/v1/bpi/currentprice.json')
https://github.com/singh-shreya6/react-app/blob/master/src/App.js