Building an Express app tends to lead to a lot of code duplication in router objects. You'll have half a dozen routes, or more, that all need to load the same object by it's ID, for example. Fortunately, Express gives us a simple way to reduce the complexity of route method handlers while also reducing code duplication, by using the param feature of a router.
In this episode, I'll show you how this feature works, and show you how to use it to load the same object in to two different routes. You'll reduce the amount of code that you need to write, and clean up your route handlers significantly.