HomeToolsAbout a20k

URLs

What is URL

Routing refers to how an application’s endpoints (URIs) respond to client requests

You define routing using methods of the Express app object that correspond to HTTP methods

URI vs URL

Source

URI (identify) and URL (locate)

  • Locators are also identifiers, so every URL is a URI, but URIs are not URLs

Caveat

Impact of trailing slash

Trailing slash is a different route than without

  • Below are two distinct routes
/api/service_name
/api/service_name/

Trailing slash potentially leads to 307 Temporary Redirect error

© VincentVanKoh