aboutsummaryrefslogtreecommitdiffstats
path: root/src/server/Main.hx
diff options
context:
space:
mode:
authorRblSb <msrblsb@gmail.com>2023-01-09 14:15:48 +0300
committerRblSb <msrblsb@gmail.com>2023-01-09 14:15:48 +0300
commit7eafa305e529ddc08d3c656e223529a3129cdf65 (patch)
treede743df9daa3713d5bdd9cde7518f24cfbce67c8 /src/server/Main.hx
parentbb582f949ecfcd38af7fc2d6c10c6e7efe167f59 (diff)
Add --port argument
for fast multichannel setups
Diffstat (limited to 'src/server/Main.hx')
-rw-r--r--src/server/Main.hx8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/server/Main.hx b/src/server/Main.hx
index 282c09a..a525f65 100644
--- a/src/server/Main.hx
+++ b/src/server/Main.hx
@@ -63,7 +63,8 @@ class Main {
function new(opts:MainOptions) {
isNoState = !opts.loadState;
- verbose = Sys.args().has("--verbose");
+ final args = Utils.parseArgs(Sys.args(), false);
+ verbose = args.exists("verbose");
statePath = '$rootDir/user/state.json';
logsDir = '$rootDir/user/logs';
// process.on("exit", exit);
@@ -97,6 +98,11 @@ class Main {
port = config.port;
final envPort = (process.env : Dynamic).PORT;
if (envPort != null) port = envPort;
+ final argPort = args["port"];
+ if (argPort != null) {
+ final newPort = Std.parseInt(argPort);
+ if (newPort != null) port = newPort;
+ }
var attempts = isNoState ? 500 : 5;
function preparePort():Void {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage