Started editing and adding real content.
This commit is contained in:
parent
5e002b3244
commit
85c1157ebb
2 changed files with 13 additions and 1 deletions
|
@ -54,6 +54,8 @@ app.use(express.static(__dirname + '/public'));
|
|||
app.get('/', function (req, res) {
|
||||
var player_number = 0;
|
||||
var stats_number = 0;
|
||||
var players = new Array();
|
||||
|
||||
database.get("SELECT COUNT(*) FROM players", function (err, row) {
|
||||
player_number = row;
|
||||
});
|
||||
|
@ -61,11 +63,16 @@ app.get('/', function (req, res) {
|
|||
stats_number = row;
|
||||
});
|
||||
|
||||
database.each("SELECT * FROM players", function(err, row) {
|
||||
players.push(row);
|
||||
});
|
||||
|
||||
res.render('index',
|
||||
{
|
||||
title: 'My Game',
|
||||
player_num: player_number,
|
||||
stats_num: stats_number
|
||||
stats_num: stats_number,
|
||||
player_list: players
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -5,6 +5,11 @@ block content
|
|||
| Registered players: #{player_num}
|
||||
p
|
||||
| Stats registered: #{stats_num}
|
||||
p
|
||||
ul
|
||||
each player in player_list
|
||||
li #{player.name}
|
||||
|
||||
block sidebar
|
||||
.widget
|
||||
h1 Access
|
||||
|
|
Loading…
Reference in a new issue