move listenPort option to argv

This commit is contained in:
Arthur Lu 2023-11-16 23:26:11 +00:00
parent 4a7b8c4753
commit d9d1846a82
2 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,6 @@
"username": "root@pam",
"password": "rootpassword"
},
"listenPort": 80,
"hostname": "paas.mydomain.example",
"domain": "mydomain.example"
},

View File

@ -12,6 +12,7 @@ import parseArgs from "minimist";
global.argv = parseArgs(process.argv.slice(2), {
default: {
package: "package.json",
listenPort: 80,
db: "./localdb.js", // relative to main.js
dbconfig: "config/localdb.json"
}
@ -30,8 +31,8 @@ app.use(cookieParser());
app.use(cors({ origin: global.db.hostname }));
app.use(morgan("combined"));
global.server = app.listen(global.db.listenPort, () => {
console.log(`proxmoxaas-api v${global.api.version} listening on port ${global.db.listenPort}`);
global.server = app.listen(global.argv.listenPort, () => {
console.log(`proxmoxaas-api v${global.api.version} listening on port ${global.argv.listenPort}`);
});
global.utils.recursiveImport(app, "/api", "routes");