4
1
Fork 0

Add dynamic accounts

This commit is contained in:
Simon Giesel 2018-02-20 01:07:10 +01:00
parent 80a10450bc
commit 1fa7f71b0b
2 changed files with 21 additions and 9 deletions

View file

@ -30,10 +30,20 @@ app.get('/', function(req, res){
data.forEach(el => { data.forEach(el => {
console.log(el.class) console.log(el.class)
}) })
res.render('index', {
instances: [
{
name: 'Test',
level: 1000
},
{
name: 'Tes2t',
level: 10200
// res.sendFile(__dirname + '/views/index.html'); }
res.render('index') ]
})
} else console.error('HTTP ERROR ' + response.statusCode + '') } else console.error('HTTP ERROR ' + response.statusCode + '')
}); });
}) })

View file

@ -12,12 +12,14 @@
<th>Class</th> <th>Class</th>
<th>Exp</th> <th>Exp</th>
</tr> </tr>
{{#instances}}
<tr> <tr>
<td>{{ name }}</td> <td>{{name}}</td>
<td>{{ level }}<img src="assets/Arrow.png" align="right"></td> <td>{{level}}<img src="assets/Arrow.png" align="right"></td>
<td>{{ gold }}<img src="assets/Gold.png" align="right"></td> <td>{{gold}}<img src="assets/Gold.png" align="right"></td>
<td>{{ class }}</td> <td>{{class}}</td>
<td>{{ exp }}</td> <td>{{exp}}</td>
</tr> </tr>
{{/instances}}
</table> </table>