Welcome to QA's learning platform (formerly Cloud Academy). Learn more about our journey here, opens in a new tab.

Introduction to Express - Express Static

Difficulty: Intermediate
Duration: 6 minutes and 19 seconds
Students: 43
Rating: 5/5

In this lesson, you will learn how to handle static files using the Express Static middleware. This lesson covers the approach needed to serve static files in an express application, along with potential errors and issues that may be encountered by doing so.

Learning Objectives

  • Implement a views route to serve a static HTML file
  • Implement the response object’s sendFile method to send an HTML file
  • View common errors when dealing with static files and learn how to handle them
  • Implement the path.join method to create the absolute path to a file
  • Understand the process variable __dirname
  • Implement the express.static middleware to create a virtual path

Intended Audience

  • This lesson is intended for anyone who wants to learn about Express

Prerequisites

Covered Topics