From 1fa7f71b0ba02df2fd374933a13c0eb3d870be10 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 20 Feb 2018 01:07:10 +0100 Subject: [PATCH] Add dynamic accounts --- index.js | 18 ++++++++++++++---- views/index.hbs | 12 +++++++----- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index fcca2ff..146f7bf 100644 --- a/index.js +++ b/index.js @@ -30,10 +30,20 @@ app.get('/', function(req, res){ data.forEach(el => { console.log(el.class) }) - - - // res.sendFile(__dirname + '/views/index.html'); - res.render('index') + res.render('index', { + instances: [ + { + name: 'Test', + level: 1000 + + }, + { + name: 'Tes2t', + level: 10200 + + } + ] + }) } else console.error('HTTP ERROR ' + response.statusCode + '') }); }) diff --git a/views/index.hbs b/views/index.hbs index 466727c..5c18f74 100644 --- a/views/index.hbs +++ b/views/index.hbs @@ -12,12 +12,14 @@ Class Exp +{{#instances}} - {{ name }} - {{ level }} - {{ gold }} - {{ class }} - {{ exp }} + {{name}} + {{level}} + {{gold}} + {{class}} + {{exp}} +{{/instances}}