-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
53 lines (35 loc) · 1.28 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
(function() {
var app, config, express, game, gameManager, io, manager, routes, siteGlobals, socketManager, sockets;
express = require('express');
routes = require('./routes');
game = require('./common/game.js');
manager = require('./common/manager.js');
config = require('./config.json');
io = require('socket.io');
siteGlobals = {
css: config.css,
js: config.js,
description: "A free online multiplayer board game based on the classic board game ludo.",
author: "Planimus Games <[email protected]>"
};
app = module.exports = express.createServer();
app.configure(function() {
app.set('views', "" + __dirname + "/views");
app.set('view engine', 'jade');
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static("" + __dirname + "/public"));
return app.set('view options', {
locals: siteGlobals
});
});
sockets = io.listen(app).sockets;
socketManager = manager.sockets(sockets);
gameManager = manager.games(sockets);
gameManager.createGame("castl");
gameManager.createGame("moutain");
app.get('/', routes.index);
app.listen(8081);
console.log("Game server listening on port %d in %s mode", app.address().port, app.settings.env);
}).call(this);