MCPcopy Create free account
hub / github.com/expressjs/body-parser / createServer

Function createServer

test/body-parser.js:146–155  ·  view source on GitHub ↗
(opts)

Source from the content-addressed store, hash-verified

144})
145
146function createServer (opts) {
147 var _bodyParser = bodyParser(opts)
148
149 return http.createServer(function (req, res) {
150 _bodyParser(req, res, function (err) {
151 res.statusCode = err ? (err.status || 500) : 200
152 res.end(err ? ('[' + err.type + '] ' + err.message) : JSON.stringify(req.body))
153 })
154 })
155}

Callers 1

body-parser.jsFile · 0.70

Calls 1

bodyParserFunction · 0.85

Tested by

no test coverage detected