Socket.io is a piece of middleware that makes it easy to build real time applications. It works really well with express. There are two parts to socket.io. The server and the client. You're going to need to call the server component with a require statement just like you do with any other piece of middleware and that means you'll need to install it as a dependency of your project. The client is another script that you'll have to add to your pages. Socket.io provides link you can use, which makes it easier. Once you set everything up, your app will be able to track new events for detecting connections, disconnections or even create your own events.
In addition to that, you'll need to also…install another script, the client side script,…that you'll have to add to your pages.…Now Socket.io provides a link you can use…which will make this a lot easier.…Once you set everything up,…your app will be able to track events…and your browser will also be able to detect connections…
In this course, Ray Villalobos walks through the process of creating full-featured websites with these technologies. First, find out how to install each package and leverage Node.js features from within Express. Then learn how to build a basic application with templating engines like EJS; create more flexible, modular code with includes and conditional statements; build APIs to manage HTTP requests to add and delete content dynamically; and configure more complex routing. Along the way, Ray implements features like customer feedback forms and real-time live chat, so you can see exactly what Node.js and Express are capable of.
- Handling HTTP requests with Node.js and Express
- Creating and modularizing routes
- Using templates
- Building flexible views
- Creating an API route
- Dealing with POST and DELETE requests
- Creating live chat features with Socket.IO