Add dynamic json display
This commit is contained in:
parent
da15fcfb53
commit
88193061fa
1 changed files with 5 additions and 17 deletions
22
index.js
22
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 + '')
|
||||
});
|
||||
|
|
Reference in a new issue