Httpster is a community developed module that lives in the npm registry and is used to create simpler Node.js web servers. In this tutorial, Alex Banks will describe the benefits of using httpster to serve files, and will demonstrate how to easily request multiple file types from a folder.
- View Offline
- Exercise Files
- In the last chapter we created some web servers…using the core http module that ships…with Node.js.…We learned that we can create servers…with this module but it takes a little bit of work.…Instead of creating a web server from essentially scratch,…npm has a lot of tools that we can use…to help us do this.…The first tool that we're going to look at…is something called httpster.…I can come down here in my find packages bar…and look for httpster, and there it is.…Httpster will give us a static file server,…so with this node module we can build…a web server that will serve static content.…
Let's go ahead and navigate to our exercise files.…In our exercise files for Chapter Seven Lesson Four,…under the Start folder, you will notice that we have…a Public folder, and in the Public folder are…the exact same html, css, and a jpeg image…of birds that we had in the last chapter…when we built a file server.…If I try to open up index.html on its own…using the File API, we can see the html page…but we don't see any of the styles…
Alex Banks shows how to install Node.js on a Mac or PC and work with the Node.js core: the global object, event loop, http module, and file system. Then he covers reading and writing data, streaming data, making http requests, and working with the node package manager (npm). In the final chapters, he shows how to start sessions on web servers, communicate with web servers and clients with WebSockets, use the Express framework to develop applications, and test and debug Node.js code. Want to speed up your Node.js workflow? Check out the tutorials on automating tasks with Grunt and npm scripts.
- What is Node.js?
- Installing Node.js
- Understanding the global object and global timing
- Importing the core modules
- Handling events
- Creating child processes
- Reading, writing, and removing files
- Working with file streams
- Making http requests
- Serving files and JSON data
- Installing npm, the node package manager
- Working with Express, the web server framework
- Using WebSockets
- Testing and debugging Node.js code
- Working with Grunt and Browserify
- Automating tasks with npm scripts
Skill Level Intermediate
1. What Is Node.js?
2. Installing Node.js
3. Node Core
4. Node Modules
5. The File System
6. The HTTP Module
7. Node Package Manager
Installing npms locally4m 4s
8. Web Servers
Creating a WebSocket server8m 30s
10. Testing and Debugging
11. Automation and Deployment
Next steps2m 4s
- 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.