i

Routing

Routing is navigation between different pages in an application.

To design an enterprise application, it needs to have well-defined routing architecture for code modularity, readability, and later on for smooth scalability as well.

If we need to navigate across different URLs based on the incoming request, we need to implement routing.

We can check the request object URLs to navigate the user to the desired pages.

Like for respective URLs, we want to redirect the user to the corresponding page.

routingDemo.js

Browser

Route : ‘/’

Route : /login

Route : ‘/register’

Route : ‘/contactUs’

In this approach, we are searching for a URL path using a comparison operator, which is not a good approach for enterprise applications having hundreds of different navigation paths.

In Enterprise applications, we use Frameworks, which we will discuss in Frameworks sections. Frameworks help to create applications faster.