- [Instructor] We are able to send requests…from the client or browser to Node,…but there is no way to do it in reverse.…There's no way for Node to tell one or more clients,…hey, there's a new message,…so the only way to achieve this behavior…with HTTP requests is to do something called polling.…With polling, every few seconds we send…an HTTP request asking the server,…hey, are there any updates?…Are there new messages I should display?…And we check over and over.…It would be much better…if the server could just tell the client…when a new message comes in…without the clients having to constantly check.…
You can think of it as a bunch…of kids in a van asking the parents every minute,…hey, are we there yet?…The parents might plead with the kids…to stop asking at one point,…and that they will tell the kids…when they arrive instead of them asking.…This is how WebSockets work…and we will be using a WebSocket library called Socket.IO…that works for both the browser and for Node.…With Socket.IO, we will be able to notify clients…
Author
Updated
4/5/2019Released
11/7/2017- Asynchronous tasks and callbacks
- Benefits and features of JavaScript
- Managing third-party packages with npm
- Node.js frameworks
- Static serving with Express
- Creating a browser app
- Exploring databases
- Saving data to MongoDB with Mongoose
- Error handling and debugging
- Simple tests and async tests
Skill Level Beginner
Duration
Views
-
Introduction
-
Welcome41s
-
-
1. Introduction to Node
-
Download and install Node1m 28s
-
2. Understanding npm: Node Package Manager
-
Write your own module2m 18s
-
-
3. Reading and Writing Files
-
Read from files4m 31s
-
Access directories1m 6s
-
Write to a file2m 46s
-
-
4. Exploring Web Frameworks
-
Node.js frameworks1m 23s
-
Express1m 6s
-
Socket.io55s
-
-
5. Building Your Demo App Chat Client for the Browser
-
Static serving with Express5m 30s
-
Create your browser app8m 43s
-
Create your Socket.io event1m 59s
-
-
6. Exploring Databases
-
Types of data frameworks2m 2s
-
Set up MongoDB1m 46s
-
Mongoose2m 59s
-
-
7. Improving Asynchronous Code
-
Nested callbacks3m 27s
-
Promises7m 14s
-
Async/await2m 44s
-
-
8. Error Handling and Debugging
-
Try/catch2m 6s
-
Finally1m 40s
-
Editor debugging4m 14s
-
-
9. Testing
-
Simple test with Jasmine4m 33s
-
Async test with Jasmine5m 33s
-
-
Conclusion
-
Next steps1m 24s
-
- 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.
CancelTake 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.
Share this video
Embed this video
Video: Connect to Socket.io from the browser app