Assuming that you’ve not set up anything.
Step 1: Installing Axios
npm install axios
Step 2: Importing and sending request
| |
For most part, that will suffice. However, you might want to call the data via an effect hook.
Step 3: Calling request with an effect hook:
| |
This will set the streams variable up.
Final Step: Installing CORS
Without CORs, you will not be able to make that request.
- Within the backend repo, install cors.
npm install cors - then within the backend index.js, require cors:
const cors = require('cors')app.use(cors())