hardlounge/src/command-line/start.js

22 lines
623 B
JavaScript
Raw Normal View History

2014-08-19 01:18:40 +00:00
var config = require("../../config.json");
var ClientManager = new require("../clientManager");
var program = require("commander");
var shout = require("../server");
program
2014-08-26 18:15:17 +00:00
.option("-p, --port <port>")
2014-08-19 01:18:40 +00:00
.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-user <name>'.")
console.log("");
} else {
var port = program.port || config.port;
shout(port, config.public);
}
});