From the course: React: Securing Applications
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Add connections to server - React.js Tutorial
From the course: React: Securing Applications
Add connections to server
- [Instructor] Okay so now let's work on the main file, the app.js, so go back into the client project, and go into components inside of source, and open up app.js. So the first thing we're going to do is fix our imports and make sure we have everything that we need. So, the first thing that I'm going to do is import axios 'cause we're going to need that. So let's go and import axios from axios. Perfect. Now, we're going to also import, useAuthO from react-auth-spa, like so, and then we'll also import our history, there's a lot of stuff that's going to happen directly inside of app that's why we're focusing only on that one for now. And now we're going to import our history file, like so, 'cause we're going to need it with our react router. Now the next thing we're going to need to do is first remove import data, so we're not going to need the data from there anymore, and we're also going to import the loading that…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Initial setup of your server6m 59s
-
(Locked)
Create your API endpoints4m 5s
-
(Locked)
Initial Auth0 setup2m 38s
-
(Locked)
Adding the files and code from Auth03m 44s
-
(Locked)
Update index for Auth0 integration4m 2s
-
(Locked)
Add connections to server5m 46s
-
(Locked)
Finalize menu with login5m 54s
-
(Locked)
-
-