Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.


Build a Simple Dynamic Site with Node.js Course

via Treehouse


Node.js is a versatile platform for building all sorts of applications. In this course, we're going to make a dynamic website that displays a Treehouse student's profile information by creating a server that will dynamically generate content, handle URLs, read from files and build a simple template engine.

What you'll learn

  • Creating an HTTP Server
  • Reading Files
  • Handling HTTP Methods
  • Customizing HTTP Headers


Creating a Simple Server in Node.js

Node.js has awesome APIs that allow you to build all types of applications. Traditionally you'd need to install a server like Apache or NGINX if you wanted to run a static or dynamic website – but Node.js allows you to write your own web server with a simple API call.

Chevron 5 steps
  • Overview


  • HTTP Servers


  • Preparing & Planning


  • Creating a Simple Server


  • HTTP Server Review

    8 questions

Handling Routes in Node.js

When you type in a web address a request is sent to a server. After a domain name, there's a forward slash and then a path to a resource on the server. Sometimes, this is called a route. In this stage, we'll take a look at how to programmatically handle routes in Node.js.

Chevron 4 steps
  • Home Route


  • User Route


  • Populating User Information


  • Handling Routes Review

    2 objectives

Creating a Basic Template Engine in Node.js

A lot of our HTML contains the same content so we're going to use a principle called DRY, or Don't Repeat Yourself and separate out the unique content in separate files. We'll also write some code that combines all of this content and put in dynamic values – in other words, we're creating a Template Engine.

Chevron 5 steps
  • Making Our Views DRY


  • Reading from Files


  • Reading Files Review

    4 questions

  • Binding Values


  • A Simple Merge Utility

    1 objective

HTTP Methods and Headers

Creating your own HTTP servers and web applications requires you to know some of the ins-and-outs of how an HTTP client and HTTP server talk to each other. In this stage we'll take a look at some HTTP headers and HTTP methods.

Chevron 5 steps
  • Sending Content Type Headers in Node.js


  • Dealing with the POST Body


  • Redirection Headers in Node.js


  • Perfection Suggestions


  • HTTP Methods and Headers Review

    8 questions

  • Extra Credit

    Create a Lorem Ipsum generator site in Node.js. Have a web form that asks for a number of words, sentences or paragraphs to generate placeholder text. Have it write to a response in a template. An example of a Lorem Ipsum generator is at

Related Courses


Start your review of Build a Simple Dynamic Site with Node.js Course

Never Stop Learning!

Get personalized course recommendations, track subjects and courses with reminders, and more.

Sign up for free