From 88193061fa9c43263defafe8a7c1416111483645 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 20 Feb 2018 01:33:22 +0100 Subject: [PATCH] Add dynamic json display --- index.js | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/index.js b/index.js index 146f7bf..16c7ca1 100644 --- a/index.js +++ b/index.js @@ -23,26 +23,14 @@ app.get('/', function(req, res){ var data = [] if (!error && response.statusCode === 200) { body.response.bot.accounts.forEach(el => { - data.push(el[Object.keys(el)]) + var tmp = el[Object.keys(el)] + tmp.logs = "" + tmp.settings = "" + data.push(tmp) }); - // Use fetched Data - data.forEach(el => { - console.log(el.class) - }) res.render('index', { - instances: [ - { - name: 'Test', - level: 1000 - - }, - { - name: 'Tes2t', - level: 10200 - - } - ] + instances: data }) } else console.error('HTTP ERROR ' + response.statusCode + '') });