Overview
Google, IBM & Meta Certificates – 40% Off
One Coursera Plus subscription covers most Professional Certificates on Coursera.
Unlock All Certificates
This beginner tutorial builds a web server with Node.js without using a framework. It covers project setup, routing, content types, file and data serving, redirects, error responses, and request logging.
Syllabus
Intro
Welcome
Overview
Project Setup
Import modules / dependencies
A minimal server
Two inefficient approaches
Setting the Content-Type
Setting the file path
Make the html extension optional
Does the requested file exist?
Routing redirects
Basic serveFile function
Calling the serveFile function
Serving JSON with the serveFile function
Serving images with the serveFile function
Sending a 404 status code
Logging requests and errors
Up and running with the web server
Taught by
Dave Gray