775ac7b58c
you must login with an BTP account in order to see the app
11 lines
358 B
JavaScript
11 lines
358 B
JavaScript
'use strict'
|
|
|
|
var http = require('http')
|
|
var StatsEmitter = require('./lib/stats_emitter')
|
|
|
|
module.exports = function (req, res, onStats) {
|
|
var statsEmitter = new StatsEmitter()
|
|
if (req instanceof http.Server) statsEmitter._server(req, res)
|
|
else if (req instanceof http.IncomingMessage) statsEmitter._request(req, res, onStats)
|
|
return statsEmitter
|
|
}
|