wants-json
A tiny ExpressJS middleware to figure out if a JSON response is expected.
When you have a single page app, you probably communicate in JSON with the server. But on the first page load you send the HTML. With this middleware you can distinct between these two requests.
ExpressJS middleware example for single page apps
var wantsJson = express = app = app app