express-json
v1.0.0
Published
A middleware for Express that sets Content-Type to text/plain if Accept header doesn't contain application/json.
Downloads
2,074
Readme
express-json
A middleware for Express
that sets Content-Type
to text/plain
if Accept
header doesn't
contain application/json
.
Installation
$ npm install express-json
Usage
var express = require('express'),
json = require('express-json');
var app = express()
.use(json())
.use(function (req, res) {
res.json({
helloWorld: 'Hello World!'
});
})
.listen(3000);