var ClientManager = new require("../clientManager"); var program = require("commander"); var server = require("../server"); var Helper = require("../helper"); program .option("-H, --host " , "host") .option("-P, --port " , "port") .option("-B, --bind " , "bind") .option(" --public" , "mode") .option(" --private" , "mode") .command("start") .description("Start the server") .action(function() { var users = new ClientManager().getUsers(); var config = Helper.getConfig(); var mode = config.public; if (program.public) { mode = true; } else if (program.private) { mode = false; } if (!mode && !users.length) { log.warn("No users found!"); log.info("Create a new user with 'lounge add '."); } else { server({ host: program.host || process.env.IP || config.host, port: program.port || process.env.PORT || config.port, bind: program.bind || config.bind, public: mode }); } });