Skip to content

Commit

Permalink
Fixed relative pathing on file writing
Browse files Browse the repository at this point in the history
Also removed unused dependencies and cleaned some comments

Fixes #68
  • Loading branch information
mqpteam committed Apr 29, 2016
1 parent f7cfb68 commit 6d1f5da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@
"durationjs": "^1.1.1",
"express": "^4.13.3",
"extend": "^3.0.0",
"less": "^2.5.3",
"less-plugin-clean-css": "^1.5.1",
"forever": "^0.15.1",
"leveldown": "^1.4.3",
"levelup": "^1.3.1",
"mongodb": "^2.1.16",
"mysql": "^2.10.2",
"nodemailer": "^2.1.0",
"path": "^0.12.7",
"ps-tree": "^1.0.1",
"request": "^2.67.0",
"ws": "^1.0.1",
"xoauth2": "^1.1.0",
"forever": "^0.15.1",
"ps-tree": "^1.0.1",
"mongodb":"^2.1.16"
"xoauth2": "^1.1.0"
}
}
7 changes: 4 additions & 3 deletions start.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var log = new(require('basic-logger'))({
showTimestamp: true,
prefix: "SocketServer"
});
var path = require('path');
////var SocketServer = require("./socketserver_mysql/socketserver");

if(!config.setup){
Expand All @@ -24,8 +25,7 @@ var webConfig = '// THIS IS AN AUTOMATICALLY GENERATED FILE\n\nvar config=JSON.p
) + '\')';

if (config.hostWebserver){
fs.writeFile('./webserver/public/lib/js/webconfig.js', webConfig);
// but works to me with fs.writeFile('./webserver/public/lib/js/'+config.room.slug+'-config.js', webConfig); --> caipira
fs.writeFileSync(path.join(__dirname, '/webserver/public/lib/js', 'webconfig.js'), webConfig);
var webserver = require('./webserver/app');
server = (config.socketServer.port == config.webServer.port || config.socketServer.port == '') ? webserver.server : null;
}
Expand All @@ -34,7 +34,8 @@ if (config.apis.musiqpad.sendLobbyStats && (!config.apis.musiqpad.key || config.
throw 'In order to send stats to the lobby you must generate an key here: https://musiqpad.com/lounge';
}

fs.writeFile('./webconfig.js', webConfig);
fs.writeFileSync(path.join(__dirname, '', 'webconfig.js'), webConfig);

var socketServer = new SocketServer(server);

process.on('uncaughtException', function(err) {
Expand Down

0 comments on commit 6d1f5da

Please sign in to comment.