stefanpenner/ember-app-kit — pull request #418 by FilmKnurd (2014-01-16 12:43:14+00:00)
Title: [#417] Returns 404 for un-handled resources

To use, place a trap404 option immediately before the catchall index
option:

```JS
app.use(static({ trap404: /.js$|.css$/ }));
app.use(static({ file: 'tmp/result/index.html' }));
```

Middleware is processed sequentially, so this should be the last call
to catch non-existent asset files. All other paths continue back to
index.html to be handled by the Ember router.

- Adds another option, trap404 to the static middleware function,
which allows you to specify a regex to capture resource paths
that should return a 404
- Adds a check in static() for the trap404 flag that searches the
request path for a matching file ending. If matched, then it sends
a 404 error and stops the middleware chain.