Express router.params - 401-advanced-javascript-jv/seattle-javascript-401d30 GitHub Wiki
Express, a common Node.js web framework for serving an application to an end user, has many capabilities. Among these is the ability for it to have a collection of routes/endpoints grouped together for the purposes of handling them all in a specific and common way.
If, for instance, you want to have a lot of different types of resources you send to your user, you can define only the parts of them which are different (/states, /cities, and /neighborhoods, for example), and then define where you want all of those to live (at /usa, for instance, so they would all become /usa/states, /usa/cities, and /usa/neighborhoods when the end user accesses them.).
Along with this router functionality comes the ability to allow variables (params) in the route, and then do different things in your server code depending on what the variable is when the user accesses that route. For instance, you could set up routes to be /:country/states, /:country/cities, and /:country/neighborhoods, and then set up a router.param(country, function); which would change its behavior depending on what country the user puts into the address. This would allow you to set behavior for many different countries, without having to change the routes of your server.