Define and Handle Routes in ExpressJS Applications

Lab Steps

lock
Understanding the ExpressJS Routing Principles
lock
Connecting to the NodeJS Web IDE
lock
Defining and Handling Routes With ExpressJS

The hands-on lab is part of this learning path

Ready for the real environment experience?

DifficultyBeginner
Time Limit45m
Students72
Ratings
5/5
starstarstarstarstar

Description

When you develop both a frontend or backend application, you want to define different logic flows that can be reached by using different paths. For this reason, when you choose a programming language and a framework to work with, one of the most important things is the routing. As the word describes, routing means to route the traffic to a certain target.

When defining routes, the resources you are exposing through a path will be reached by performing an HTTP request. Because of this, you always need to associate an HTTP method with a route. ExpressJS lets you define routing and routers in a very easy and efficient way, so you can manage all your paths very clearly.

In this lab, you will understand the basics of the ExpressJS routing system, you will define some routes, and you will create a router to better handle specific routes.

Learning Objectives

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

  • Understand the principles of routing in ExpressJS
  • Define ExpressJS routes
  • Create and use an ExpressJS router

Intended Audience

  • Software engineers that want to deep dive into the ExpressJS routing system
  • JavaScript developers that are curious about the ExpressJS routing system

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
Students18273
Labs94
Courses2
Learning paths7

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.