Browse Source

getlog

master
zeus 4 years ago
parent
commit
f7a2a9692b
  1. 19
      swarmlab-app/src/run/app.js

19
swarmlab-app/src/run/app.js

@ -291,7 +291,7 @@ app.get('/get_log', [
cors(corsOptions), (req, res, next) => {
(async() => {
/*
var mongourl = "mongodb://"+CONFIG.mongo.user+":"+CONFIG.mongo.password+"@ondemand_playground_mongo1:27017,ondemand_playground_mongo2:27017,ondemand_playground_mongo3:27017,ondemand_playground_mongo4:27017,ondemand_playground_mongo5:27017,ondemand_playground_mongo6:27017,ondemand_playground_mongo7:27017/fluent?replicaSet=rs1&authSource=swarmlabplaygroundstats"
const OPTS = {
useNewUrlParser: true,
@ -312,10 +312,8 @@ MongoClient.connect(mongourl, OPTS, function(err, client){
stream.on('data', function (doc) {
console.log(JSON.stringify(doc))
//socket.write(JSON.stringify({'action': 'log','param': doc.log}));
});
}
});
*/
var RES = new Object();
RES.token = req.query["token"]
RES.start = req.query["start"]
@ -324,13 +322,20 @@ stream.on('data', function (doc) {
var isvalid = await checkToken(RES.token);
if(isvalid.action == 'ok'){
console.log("Authserver ok " + RES.token);
RES.error = true
RES.error = 'ok'
}else{
console.log("Authserver no " + RES.token);
RES.error = false
RES.error = 'no'
}
RES.error_msg = "ok"
res.json(RES)
});
}
});
})()
});

Loading…
Cancel
Save