testdouble/lineman — pull request #60 by davemo (2013-05-14 04:45:34+00:00)
Title: This enables pushState support in Express

I figured it would be nice for Lineman to be able to simulate what configuring a server with HTML5 PushState would look like. This was surprisingly easy :+1:

Since express doesn't handle 404 or any other errors explicitly this
simply exploits that fact and adds 1 final piece of middleware to the
chain; this has the effect of serving up `generated/index.html` on any
request that would yield a 404

In conjunction with enabling pushState for Backbone/Angular/Embers
routing abstractions this basically simulates what having a server
configured to work with HTML5 pushState works like. Yay? :)

This doesn't modify any behaviour unless the user adds a simple line to `config/application` as follows:

```javascript
server: {
pushState: true
}
```

I tested this with a couple of apps and it seems to work pretty well but I wanted to discuss before merging. Seems pretty low risk to me given no effects take place unless users explicitly add this in the config.

Thoughts from @searls, @kbaribeau, @jasonkarns welcome :)