From the course: Express Essentials: Build Powerful Web Apps with Node.js

Unlock the full course today

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

Let's GET some data: Creating a basic data endpoint

Let's GET some data: Creating a basic data endpoint

From the course: Express Essentials: Build Powerful Web Apps with Node.js

Let's GET some data: Creating a basic data endpoint

- [Instructor] So far in this course, we have set up some basic routes using the HTTP methods get, post, put, and delete. We've sent data to the client, but it's been in messages that we've hard-coded to simply illustrate how to get our endpoints up and running. In this video, we want to take our mock data and serve it to our client via a get. This is something that you will do time and time again, as you build endpoints with express, we're going to start in our code editor and then test with postman and the browser. In our index JS file, let's take a look at our get route. We're going to go ahead and clear out the response.send that we have here and make some changes. Typically, when you're working with an application that is using node and express, you are likely hooking into a database as well. This is where you be querying and fetching existing data. For the scope of this course, we are simply focusing on…

Contents