diff --git a/lib/webInterface.js b/lib/webInterface.js index 26cac9b..ee7b454 100644 --- a/lib/webInterface.js +++ b/lib/webInterface.js @@ -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); diff --git a/web/index.html b/web/index.html index 31ddb7c..c2d80a6 100644 --- a/web/index.html +++ b/web/index.html @@ -5,8 +5,9 @@ - - + + +