optimize recorder

This commit is contained in:
OttoMao
2015-08-06 23:13:17 +08:00
parent edaf638f3c
commit 39ae0f4648
7 changed files with 101 additions and 43 deletions

View File

@@ -37,15 +37,15 @@ function webInterface(config){
return next();
});
// app.get("/summary",function(req,res){
// recorder.getSummaryList(function(err,docs){
// if(err){
// res.end(err.toString());
// }else{
// res.json(docs.slice(docs.length -500));
// }
// });
// });
app.get("/lastestLog",function(req,res){
recorder.getRecords(null,60,function(err,docs){
if(err){
res.end(err.toString());
}else{
res.json(docs);
}
});
});
app.get("/fetchCrtFile",function(req,res){
if(crtFilePath){
@@ -108,6 +108,7 @@ function webInterface(config){
app.use(express.static(staticDir));
//plugin from rule file
if(typeof userRule._plugIntoWebinterface == "function"){
userRule._plugIntoWebinterface(app,function(){
app.listen(port);