code backu

This commit is contained in:
OttoMao
2015-04-28 21:10:14 +08:00
parent a63063ee3c
commit 329f84ee47
5 changed files with 19628 additions and 24 deletions

View File

@@ -78,14 +78,16 @@ function webInterface(config){
res.end(resDom);
});
var indexTpl = fs.readFileSync(path.join(staticDir,"/index.html"),{encoding:"utf8"}),
indexHTML = util.simpleRender(indexTpl, {
rule : ruleSummary || "",
wsPort : wsPort,
ipAddress : ipAddress || "127.0.0.1"
});
app.use(function(req,res,next){
var indexTpl = fs.readFileSync(path.join(staticDir,"/index.html"),{encoding:"utf8"}),
indexHTML = util.simpleRender(indexTpl, {
rule : ruleSummary || "",
wsPort : wsPort,
ipAddress : ipAddress || "127.0.0.1"
});
if(req.url == "/"){
res.setHeader("Content-Type", "text/html");
res.end(indexHTML);