- Node.js +18
- Install all dependencies by running
npm install
command. - Get your API Key from https://www.cryptocompare.com/cryptopian/api-keys
. After login, click on 'Create an API Key' or if you have already generated click on 'Add another api key'
. Enter a name then check
Read All Price Streaming and Polling Endpoints
and clickAdd
green button . Copy the API Key. - Copy
.env.sample
to.env
file in the root directory and past the API key that you copied afterREACT_APP_CRYPTOCOMARE_API_KEY=
. Note: I know this solution is not the best but I don't want to store my API key in the .env but we can save it in the backend or use Next.js.
Run npm start
and go to http://localhost:3000
in your browser to see it;
You can change API Cache expiration time by following:
1- Open src/config/api.js
2- Change cryptoCacheConfigs.ttl
property in seconds. (i.e. 60 ==> 1 minutes)
- Run
npm run build
- install
serve
package if didn't exist in your system.(npm i -g serve
) - Run
serve -s build
and go tohttp://localhost:3000
in your browser to see ito