fix server not starting

broken by af421ec
This commit is contained in:
jomo 2015-02-13 20:48:36 +01:00
parent c2a4b3f9f0
commit 99a5a34f3b
3 changed files with 7 additions and 5 deletions

View File

@ -17,5 +17,5 @@ if (cluster.isMaster) {
setInterval(cleaner.run, config.cleaning_interval * 1000);
} else {
require("../server.js")();
require("../server.js").boot();
}

View File

@ -111,7 +111,7 @@ h4 {
}
.code .example {
cursor: pointer;
cursor: text;
}
.code .example:hover {

View File

@ -94,7 +94,9 @@ exp.boot = function(callback) {
var bind_ip = process.env.BIND || "127.0.0.1";
logging.log("Server running on http://" + bind_ip + ":" + port + "/");
server = http.createServer(requestHandler).listen(port, bind_ip, function() {
if (callback) {
callback();
}
});
};
@ -102,12 +104,12 @@ exp.close = function(callback) {
server.close(function() {
callback();
});
}
};
module.exports = exp;
if (require.main === module) {
exp.boot(function(){});
exp.boot();
// cleaning worker
setInterval(clean.run, config.cleaning_interval * 1000);