coverage-collector
Advanced tools
Comparing version 0.0.2 to 0.0.3
10
index.js
var http = require("http"); | ||
var connect = require('connect'); | ||
var bodyParser = require('body-parser'); | ||
var server; | ||
function start(options){ | ||
@@ -9,3 +10,3 @@ options=options||{}; | ||
global._data=global._data||[]; | ||
app.use(bodyParser()); | ||
app.use(bodyParser({limit:'50mb'})); | ||
app.use(require('./list')()); | ||
@@ -18,3 +19,6 @@ app.use(require('./receive')()); | ||
res.end(); | ||
process.exit(); | ||
if(server){ | ||
server.close(); | ||
server=null; | ||
} | ||
}else{ | ||
@@ -27,5 +31,5 @@ next(); | ||
}); | ||
http.createServer(app).listen(port); | ||
server=http.createServer(app).listen(port); | ||
console.log("Collector started on port %d", port); | ||
} | ||
module.exports=start; |
{ | ||
"name": "coverage-collector", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A simple server for collecting code coverage objects", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,8 +5,5 @@ global._data=global._data||[]; | ||
if(req.url.substr(1)==='data' && req.method.toLowerCase()==='post'){ | ||
console.log("received post data\n"); | ||
console.log(req.body); | ||
global._data.push(req.body); | ||
res.statusCode=204; | ||
res.end(); | ||
}else{ | ||
@@ -13,0 +10,0 @@ next(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
61
14240