Started editing and adding real content.

This commit is contained in:
José Carlos Cuevas 2013-06-01 23:06:51 +02:00
parent 5e002b3244
commit 85c1157ebb
2 changed files with 13 additions and 1 deletions

View file

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

View file

@ -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