From the course: Vue.js: Creating and Hosting a Full-Stack Site

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Creating routes in Express

Creating routes in Express

- [Instructor] All right, so at this point we have a basic server setup and we have Postman, which is really going to help us test our different server endpoints. So what we're going to do next is we're going to take a look at how to start creating some endpoints on our server that will be useful to our fullstack application, right? So what we're going to start off with are three important endpoints that will allow our front end eventually to load data from our server. Now, these three endpoints are going to look like this. The first endpoint is going to be an endpoint for loading all of the products. So for that we're going to say app.get lkv and the endpoint for that is going to be /products and we'll see how to implement this in just a second. But the callback is going to look the same for all of these. We're going to have request and response, which again we'll talk about in more detail shortly. The next endpoint that we're…

Contents