Introduction to Express

Introducing JavaScript's Express web framework, a lightweight, modular library for building web applications on top of Node

Scroll down...




Nearly every web server must fulfill a few basic responsibilities. It must deal with incoming requests by responding to them with the appropriate data. Static web servers will simply respond with the file for the given path. For example, "/about.html" will find and return the about.html file from the server's public directory. While this will get the job done in many cases, when we build web applications, we require dynamic responses. Every request, even those to the same URL, can return different data ("/news.html" should always show the newest news!).


Express is a JavaScript library that exists to help you fulfill your web server duties. It gives you tools for routing incoming requests matching certain URLs to specific responses. It is also very simple to integrate with a templating library (a templating library is a piece of software that takes some data and some markup and returns compiled markup - we will be using Handlebars). Express is less of a full-featured solution than other frameworks (a framework is a more complex set of functionalities bundled together in one package that provides the developer with a structure to write code on alongside a handful of helpers for everything that he needs to build an application - templating library, client/server communication, routing module, etc.) you may have heard of—such as Rails—but its unopinionated nature allows for easy customization (Express is a very thin layer of functionality - it does not enforce anything upon the developer). Because it's focused on solving a few key problems while leaving the rest to other libraries, there is not a tremendous amount you need to know to get started. So let's get started!

Sign up to track your progress for free


There are no additional resources for this lesson just yet!

Sorry, comments aren't active just yet!

Next Lesson: Hello Express