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
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…
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
-
-
-
-
Getting started: Server and project setup16m 24s
-
(Locked)
Mock data is served: Adding data to your server6m 34s
-
(Locked)
What are HTTP methods and routes?8m 34s
-
(Locked)
Postman: A free tool for testing4m 28s
-
(Locked)
Let's GET some data: Creating a basic data endpoint2m 37s
-
(Locked)
Serving static files with Express6m 36s
-
-
-
-
-