reconstruct map local

This commit is contained in:
OttoMao
2015-07-07 17:31:56 +08:00
parent b595e3aa9c
commit 8a146f7373
36 changed files with 56684 additions and 530 deletions

View File

@@ -14,8 +14,13 @@ var express = require("express"),
function webInterface(config){
var port = config.port,
wsPort = config.wsPort,
ruleSummary = config.ruleSummary,
ipAddress = config.ip;
ipAddress = config.ip,
userRule = config.userRule,
ruleSummary = "";
try{
ruleSummary = userRule.summary();
}catch(e){}
var self = this,
myAbsAddress = "http://" + ipAddress + ":" + port +"/",
@@ -80,8 +85,6 @@ function webInterface(config){
res.setHeader("Content-Type", "text/html");
res.end(resDom);
});
app.use(function(req,res,next){
var indexTpl = fs.readFileSync(path.join(staticDir,"/index.html"),{encoding:"utf8"}),
@@ -100,7 +103,14 @@ function webInterface(config){
});
app.use(express.static(staticDir));
app.listen(port);
if(typeof userRule._plugIntoWebinterface == "function"){
userRule._plugIntoWebinterface(app,function(){
app.listen(port);
});
}else{
app.listen(port);
}
self.app = app;
}