From e560ad5cda2d018934c232cda3cfcff398684951 Mon Sep 17 00:00:00 2001 From: zeus Date: Thu, 10 Dec 2020 23:22:14 +0200 Subject: [PATCH] add rest --- swarmlab-app/src/run/app.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index 1df6452..88c508a 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -358,7 +358,15 @@ cors(corsOptions), (req, res, next) => { RES.token = req.query["token"] RES.start = req.query["start"] RES.end = req.query["end"] - RES.swarmlabname = req.query["swarmlabname"] + 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) + } }