Override `Accept` to `application/json` header if URL ends with .json (Connect/Express middleware)
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
Makefile
README.md
index.js
package.json

README.md

Will change the request's Accept header to application/json if the URL ends with .json, or to application/xml if the URL ends with .xml.

Install

npm install connect-acceptoverride

Usage

var acceptOverride = require('connect-acceptoverride');
app.use(acceptOverride());