4
1
Fork 0

Add dynamic json display

This commit is contained in:
Simon Giesel 2018-02-20 01:33:22 +01:00
parent da15fcfb53
commit 88193061fa

View file

@ -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 + '')
});