Skip to content

Commit 3684d59

Browse files
Stanley288darrachequesne
authored andcommittedAug 26, 2017
[docs] Use path.join instead of concatenating paths (#3014)
1 parent dd69abb commit 3684d59

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎examples/chat/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Setup basic express server
22
var express = require('express');
33
var app = express();
4+
var path = require('path');
45
var server = require('http').createServer(app);
56
var io = require('../..')(server);
67
var port = process.env.PORT || 3000;
@@ -10,7 +11,7 @@ server.listen(port, function () {
1011
});
1112

1213
// Routing
13-
app.use(express.static(__dirname + '/public'));
14+
app.use(express.static(path.join(__dirname, 'public')));
1415

1516
// Chatroom
1617

0 commit comments

Comments
 (0)
Please sign in to comment.