Integrating Middlewares in ExpressJS Applications

Lab Steps

lock
Understanding the ExpressJS Middlewares Principles
lock
Connecting to the NodeJS Web IDE
lock
Writing and Integrating Middlewares in ExpressJS

The hands-on lab is part of this learning path

Ready for the real environment experience?

DifficultyIntermediate
Time Limit45m
Students9
Ratings
5/5
starstarstarstarstar

Description

When building a complex application, you sometimes need to integrate middle parts between two logic flows. As an example, one of the most known middle parts is the authentication and then the authorization parts. When you trigger an endpoint, before reaching the logic associated, you want to authenticate the request. These middle parts are called middlewares. Because of their importance, the ExpressJS framework provides an easy way to define middlewares. You can both define local middlewares, so they will be associated to a single part (such as a single route); but you can also define global middlewares, so they will be associated to multiple parts.

In this lab, you will understand the basic concepts of middlewares, you will try to use pre-defined middlewares, and you will then create two custom middlewares that you will implement.

Learning Objectives

Upon completion of this beginner level lab, you will be able to:

  • Understand the principles of middlewares in ExpressJS
  • Create and integrate ExpressJS middlewares

Intended Audience

  • Software engineers that want to deep dive into the ExpressJS middlewares system
  • JavaScript developers that need to define middlewares for their ExpressJS applications

Prerequisites

To get the most out of this lab, you should have basic knowledge of the ExpressJS framework. To achieve this, we suggest taking the following lab and courses:

About the Author
Students16833
Labs55
Courses1
Learning paths3

Stefano studies Computer Science and is passionate about technology. He loves working with Cloud services and learning all the best practices for them. Google Cloud Platform and Amazon Web Services are the cloud providers he prefers. He is a Google Cloud Certified Associate Cloud Engineer. Node.js is the programming language he always uses to code. When he's not involved in studying or working, Stefano loves riding his motorbike and exploring new places.