mirror of
https://github.com/ION606/archivebot.git
synced 2026-05-14 22:16:56 +00:00
22 lines
375 B
JavaScript
22 lines
375 B
JavaScript
|
|
var http = require('http');
|
||
|
|
var daemon = require('../../');
|
||
|
|
|
||
|
|
var port = process.argv[2];
|
||
|
|
|
||
|
|
daemon({
|
||
|
|
stdout: process.stdout,
|
||
|
|
stderr: process.stderr
|
||
|
|
});
|
||
|
|
|
||
|
|
var server = http.createServer(function(req, res) {
|
||
|
|
res.end('' + process.pid);
|
||
|
|
});
|
||
|
|
|
||
|
|
server.listen(port);
|
||
|
|
|
||
|
|
// safety, kills process if test framework doesn't
|
||
|
|
setTimeout(function() {
|
||
|
|
process.exit();
|
||
|
|
}, 5000);
|
||
|
|
|