In this video, explore the most common methods used to send a response back to the client within Express's APIs.
- [Instructor] With routes there are multiple response types…we can do and we'll go through a few of them.…We've already done .send and .json quite a bit.….Send basically sends various responses.…For example, we've already sent a message to the browser…but we could also render pure HTML by coding it…directly into our response.…The .json basically sends a JSON response to the client…ready to be consumed by front end code…which we've done in our code.…Let's explore a few more examples.…
For those examples, I'm going to do a getCall,…but you can put or post or delete if you want,…so, for example, if you do a put call…and then you want to send it to another web page…then you could do res.redirect,…and basically send them to another page.…You can use those response types or response methods…to any of those methods for the app here.…For example, let's do a get for that particular item…so we can actually test it in our browser.…
Then what we'll do for the next one, we'll do an end.…Let's basically comment this one here,…
- Creating a basic data endpoint
- Routing with Express
- Adding a static route for file serving
- Basic middleware with Express
- Built-in middleware and error-handling middleware
- Debugging in an Express application
- Security best practices with Express
Skill Level Beginner
Building RESTful Web APIs with Node.js and Expresswith Emmanuel Henri1h 40m Intermediate
1. Setting Up Express
2. Getting Started
3. Routing with Express
4. Middleware with Express
5. Advanced Topics in Express
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.