router

Missing the Connect Router middleware for Node.js ?

Submitted by Frederic Marand on

I recently decided to actually run the examples in David Herron's Node Web Development book (disclaimer: Amazon affiliate link) and, while all examples until the middle of chapter 4 worked with the current Node 0.6.14 version, the Connect examples rely on the Router middleware, which TJ Holowaychuck removed from Connect.

Of course, Connect 1.6.1 still contains the Router, but it only works from Node 0.4.1 included to 0.5.0 excluded. And I still wanted to see these examples run on a current Node. A simple (and dirty) hack did the trick: