diff --git a/package.json b/package.json index 935673f..8f0654d 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/start.js b/start.js index 753464a..e3c095d 100644 --- a/start.js +++ b/start.js @@ -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){ @@ -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; } @@ -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) {