From the course: Angular: Creating and Hosting a Full-Stack Site

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create a listings endpoint

Create a listings endpoint

From the course: Angular: Creating and Hosting a Full-Stack Site

Start my 1-month free trial

Create a listings endpoint

- [Instructor] So what we've seen so far has been a really simple example, but now that we understand the basic mechanics of adding routes to our hapi server and interacting with those routes using Postman, we can move on to making our server do some more helpful things. Now, the first of those things we're going to do is add a listings endpoint for our front end listings page to load data from, but before we create our routes, let's do what we did with our front end and copy and paste some fake data into our server. Basically, what we can do is just take the fake data from the front end and put it into a new file in our backend. Now, the first thing we're going to do is create a new folder in our source directory. We'll call this routes, and as you might've guessed, this is the directory that will hold all the files for our server's routes, and then inside this routes thing, before we actually create any routes,…

Contents