There are two definitions for routers on the web:

  1. For the network layer, the router is a networking device that decides data Packets directions. They are distributed by retailers allowing user interaction to the internet.
  2. For SPA in application layer, router is a library that decides what web page is presented by a given URL. This middleware module is used for all URL functions, as these are given a path to a file that is rendered to open the next page.

Learn More

General knowledge

For network layer context:

For SPA in application layer context, most of the popular SPA frameworks has its routing library: