MCPcopy Create free account
hub / github.com/expressjs/response-time / createServer

Function createServer

test/test.js:141–152  ·  view source on GitHub ↗
(opts, fn)

Source from the content-addressed store, hash-verified

139})
140
141function createServer (opts, fn) {
142 var _responseTime = responseTime(opts)
143 return http.createServer(function (req, res) {
144 _responseTime(req, res, function (err) {
145 setTimeout(function () {
146 fn && fn(req, res)
147 res.statusCode = err ? (err.status || 500) : 200
148 res.end(err ? err.message : 'OK')
149 }, 10)
150 })
151 })
152}
153
154function shouldNotHaveHeader (header) {
155 return function (res) {

Callers 1

test.jsFile · 0.85

Calls 1

responseTimeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…