Browse Source

add rest

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

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

@ -359,6 +359,14 @@ cors(corsOptions), (req, res, next) => {
RES.start = req.query["start"]
RES.end = req.query["end"]
RES.swarmlabname = req.query["swarmlabname"]
/*
*
* validate
*
*/
var isvalid = await checkToken(RES.token);
if(isvalid.action == 'ok'){
console.log("Authserver ok " + RES.token);
@ -409,8 +417,12 @@ cors(corsOptions), (req, res, next) => {
//if( resdata.data.filter(item1 => item1.res25swarmlabname.includes(nameofswarmlab)).length > 0 ){
var regexlog = new RegExp(nameofswarmlab);
if( resdata.data.filter(item1 => regexlog.test(item1.res25swarmlabname))){
console.log('----->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>--- ' + nameofswarmlab)
resdataarray.push(item[i])
RES.found = item[i]
}else{
console.log('-----<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<--- ' + nameofswarmlab)
}
}

Loading…
Cancel
Save