Skip to content

Commit 23be03d

Browse files
committed
Updated deps. Changed absolute links
1 parent 7aebf57 commit 23be03d

File tree

3 files changed

+34
-23
lines changed

3 files changed

+34
-23
lines changed

package.json

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
{
2-
"name": "node-multidraw",
3-
"description": "A multi-user drawing app",
4-
"repository": "https://github.com/timatooth/node-multidraw",
5-
"readme": "See README file",
6-
"version": "0.5.0",
7-
"dependencies": {
8-
"express": "3.16.x",
9-
"jade": "1.6.x",
10-
"socket.io": "1.0.6",
11-
"redis": "0.12.x",
12-
"lzwcompress": "0.1.x",
13-
"node-minify": "0.10.x"
14-
},
15-
"engines": {
16-
"node": "0.10.x",
17-
"npm": "1.2.x"
18-
}
2+
"name": "node-multidraw",
3+
"description": "A multi-user drawing app",
4+
"repository": "https://github.com/timatooth/node-multidraw",
5+
"readme": "See README file",
6+
"version": "0.5.0",
7+
"dependencies": {
8+
"express": "4.1.x",
9+
"jade": "1.8.x",
10+
"socket.io": "1.2.x",
11+
"redis": "0.12.x",
12+
"lzwcompress": "0.1.x",
13+
"node-minify": "1.0.x",
14+
"compression": "1.2.x",
15+
"morgan": "~1.5.0"
16+
},
17+
"engines": {
18+
"node": "0.10.x",
19+
"npm": "1.3.x"
20+
}
1921
}

server.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ var port = process.env.PORT || 5000;
22
console.log("Listening on port " + port);
33
var http = require('http')
44
var express = require('express'), app = express();
5+
var morgan = require('morgan'); //http logger module
6+
var compression = require('compression')
57
var server = http.createServer(app).listen(port);
68
var jade = require('jade');
79
var io = require('socket.io').listen(server);
@@ -18,8 +20,7 @@ var netUsage = 0;
1820
//compress all JS into one file on startup
1921
new compressor.minify({
2022
type: 'uglifyjs',
21-
fileIn: ['public/socket.io-1.0.6.min.js',
22-
'public/alertify.min.js',
23+
fileIn: ['public/alertify.min.js',
2324
'public/jquery.hammer.min.js',
2425
'public/lzwCompress.js',
2526
'public/draw.js'
@@ -47,19 +48,26 @@ new compressor.minify({
4748
}
4849
});
4950

50-
app.use(express.compress());
51+
app.use(compression())
5152
app.use(express.static(__dirname + '/public', {maxAge: 60*60*24*1000}));
52-
app.use(express.logger());
53+
app.use(morgan('dev'));
5354

5455
app.set('views', __dirname + '/views');
5556
app.set('view engine', 'jade');
5657
app.set('view options', {layout: false });
5758
app.enable('trust proxy');
5859

60+
/* Main 'lobby' canvas */
5961
app.get('/', function(req, res){
6062
res.render('main.jade');
6163
});
6264

65+
/* User canvas */
66+
app.get("/c/:canvasname", function (req, res, next) {
67+
res.render('main.jade');
68+
});
69+
70+
6371
redisClient.on("error", function(err){
6472
console.log("Redis Error: " + err);
6573
});

views/main.jade

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ html
1010
meta(property="og:image:width" content="1600")
1111
meta(property="og:image:height" content="1000")
1212
meta(property="og:description" content="Draw with everyone else online in realtime!")
13-
link(rel="stylesheet" href="style.min.css")
13+
link(rel="stylesheet" href="/style.min.css")
1414
body
1515
div#colourPanel
1616
div#colourPanelTab C
@@ -44,4 +44,5 @@ html
4444
p Source code on <a href="https://github.com/timatooth/node-multidraw">GitHub</a>
4545
input(type="text" id="chatBox" placeholder="Chat" maxlength="135")
4646
script(src="//code.jquery.com/jquery-2.1.1.min.js")
47-
script(src="draw.min.js")
47+
script(src="/socket.io/socket.io.js")
48+
script(src="/draw.min.js")

0 commit comments

Comments
 (0)