0.0.1 • Published 9 years ago

sw-body-json v0.0.1

Weekly downloads
11
License
-
Repository
github
Last release
9 years ago

sw-body-json

Provides a middlware handler which parses Content-Type: application/json bodies into a value on req.body.

Install

npm install sw-body-json

Example

var http = require('http');
var sw = require('simpleware');


var bodyjson = require('sw-body-json')({
	maxLength: 8192 // The maximum length of the body
});

app.post('/posttopath', bodyjson, function(req, res) {
	res.end(req.body.say);
});