From the course: React: Securing Applications

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Create your API endpoints

Create your API endpoints - React.js Tutorial

From the course: React: Securing Applications

Create your API endpoints

- [Instructor] Now that we've got a server running. We can start adding the code we need to serve API endpoints. Let's get to it. So, if you go into the Exercise Files, and then in the Resources folder here, you have a data.txt. So, this is basically the data that we're going to serve for the front end to read. So, if we take a look at this, this is basically a list of some of my old courses, and we're going to create a data point with that. So, what I'm going to do is basically copy all of this. And copy it like so. So, that's all you need to do. And now what we're going to do is go back to our code in VS code, and we're going to create inside of the index dot js a get call, and that's going to be our end point. So, let's go ahead and do that. So, after somewhere around here, I'm going to create a get endpoint, and this is going to be a list of my courses. And then a request and response, which are primarily the…

Contents