Learn how to use HTTP status codes for effective server-to-client communication.
- So in this video we'll talk about HTTP status codes … and I'll show you how to implement them using Express.js. … So these are what HTTP status codes look like … at least the main ones that we'll be using. … The 200's are basically all success status codes. … 400 and 500 are all error codes. … 400 usually means it's the client's fault. … Either he sent a bad request or … you're unauthorized, things like that. … And 500 usually means it's related to … the servers, such as gateway timeout, … internal server error, things like that. … So I'll be using the status codes … to communicate with the client … and let them know what went wrong. … So start off by going to the auth controller file … and right here for the index, we know this a … success so we'll return a 200 status code. … And actually we'll return a 204 because … we're not returning any data here yet … and then for this validation failure … we'll send back a 400 which basically means a bad request … because at that point it means you've failed validation …
- Single-page applications and Vue.js
- Preparing your development environment
- Creating a Vue.js application
- Using the Vue.js router
- Building a RESTful back-end API with Node.js and Express.js
- Connecting to MongoDB
- Validating and managing a user session
- Connecting Vue.js to a back-end server
Skill Level Intermediate
1. Getting to Know the MEVN Stack
2. Preparing Your Development Environment
3. Vue.js Core Concepts
4. Building a RESTful Back-End API with Node.js and Express.js
Check HTTP status codes3m 17s
5. Connecting Your Application to MongoDB
6. User Authentication, JWTs, and Session Management
7. Finalizing Your Application
- 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.