diff --git a/config.js b/config.js index a88777cc..677f36f4 100644 --- a/config.js +++ b/config.js @@ -1,4 +1,5 @@ module.exports = { + port: 9000, nick: "temp_name", fullname: "Temporary Name", autoConnect: true, diff --git a/index.js b/index.js index bbe6a444..35dab351 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,3 @@ -var argv = require("commander") - .option("-p, --port ", "port to use", parseInt) - .parse(process.argv); - -PORT = 80; // Default port -if (argv.port) { - PORT = argv.port; -} - var server = new (require("./lib/server.js"))() - .listen(PORT); \ No newline at end of file + .listen(); \ No newline at end of file diff --git a/lib/server.js b/lib/server.js index 2f422327..00aed0d4 100644 --- a/lib/server.js +++ b/lib/server.js @@ -12,11 +12,11 @@ function Server() { this.networks = new models.NetworkCollection; } -Server.prototype.listen = function(port) { +Server.prototype.listen = function() { var self = this; var http = connect() .use(connect.static("client")) - .listen(port); + .listen(config.port); this.networks.on("all", function(action, data) { this.sockets.emit(action, data); diff --git a/package.json b/package.json index 3f94d4ad..8557e7b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chat", - "description": "A web-based client/server IRC chat", + "description": "Web client/server IRC chat", "version": "0.1.0", "author": { "name": "Mattias Erming", @@ -8,7 +8,6 @@ }, "dependencies": { "backbone": "1.1.2", - "commander": "2.1.0", "connect": "2.13.0", "irc": "0.3.6", "lodash": "2.4.1", @@ -24,7 +23,7 @@ ], "main": "./index.js", "scripts": { - "start": "nodemon index.js -p 9000" + "start": "nodemon index.js" }, "repository": { "type": "git",