From the course: Advanced Node.js

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Streaming to the browser

Streaming to the browser - Node.js Tutorial

From the course: Advanced Node.js

Start my 1-month free trial

Streaming to the browser

- [Voice Over] Thus far, we've taken a closer look at how node JS handles asynchronous processes with callbacks, promises, and streams. Now it's time to put our knowledge to work by implementing a web server that handles upload and download streams. And node JS streams are everywhere. And the idea is that you wanna stream everything. So let's go ahead and get started building an HTTP server that can stream a video to the web browser. So I'm inside of the exercise files under chapter three, chapter three lesson one. And within the start folder, we have a blank index JS. And we're just gonna go ahead and create our server from scratch here. So the first thing I'm gonna go ahead and do is I'm gonna destructure the create server function from the HTTP module. And then we're gonna stream a video to the server, so I'm also gonna pull out the create read stream method from the file system. And then finally, we're gonna stream a video file, so let me go ahead and add a reference to that file,…

Contents