Merge pull request #73 from stuartpb/patch-1

Use PORT and IP environment variables
This commit is contained in:
Mattias Erming 2014-09-09 15:07:12 +02:00
commit 5940d1d800
1 changed files with 23 additions and 23 deletions

View File

@ -1,23 +1,23 @@
var config = require("../../config.json");
var ClientManager = new require("../clientManager");
var program = require("commander");
var shout = require("../server");
program
.option("-h, --host <ip>")
.option("-p, --port <port>")
.command("start")
.description("Start the server")
.action(function() {
var users = new ClientManager().getUsers();
if (!config.public && !users.length) {
console.log("");
console.log("No users found!");
console.log("Create a new user with 'shout add <name>'.")
console.log("");
} else {
var host = program.host || config.host;
var port = program.port || config.port;
shout(port, host, config.public);
}
});
var config = require("../../config.json");
var ClientManager = new require("../clientManager");
var program = require("commander");
var shout = require("../server");
program
.option("-h, --host <ip>")
.option("-p, --port <port>")
.command("start")
.description("Start the server")
.action(function() {
var users = new ClientManager().getUsers();
if (!config.public && !users.length) {
console.log("");
console.log("No users found!");
console.log("Create a new user with 'shout add <name>'.")
console.log("");
} else {
var host = program.host || process.env.IP || config.host;
var port = program.port || process.env.PORT || config.port;
shout(port, host, config.public);
}
});