move listenPort option to argv
This commit is contained in:
parent
e2cf883e64
commit
a55b9a58d7
@ -20,7 +20,6 @@
|
|||||||
"username": "root@pam",
|
"username": "root@pam",
|
||||||
"password": "rootpassword"
|
"password": "rootpassword"
|
||||||
},
|
},
|
||||||
"listenPort": 80,
|
|
||||||
"hostname": "paas.mydomain.example",
|
"hostname": "paas.mydomain.example",
|
||||||
"domain": "mydomain.example"
|
"domain": "mydomain.example"
|
||||||
},
|
},
|
||||||
|
@ -12,6 +12,7 @@ import parseArgs from "minimist";
|
|||||||
global.argv = parseArgs(process.argv.slice(2), {
|
global.argv = parseArgs(process.argv.slice(2), {
|
||||||
default: {
|
default: {
|
||||||
package: "package.json",
|
package: "package.json",
|
||||||
|
listenPort: 80,
|
||||||
db: "./localdb.js", // relative to main.js
|
db: "./localdb.js", // relative to main.js
|
||||||
dbconfig: "config/localdb.json"
|
dbconfig: "config/localdb.json"
|
||||||
}
|
}
|
||||||
@ -30,8 +31,8 @@ app.use(cookieParser());
|
|||||||
app.use(cors({ origin: global.db.hostname }));
|
app.use(cors({ origin: global.db.hostname }));
|
||||||
app.use(morgan("combined"));
|
app.use(morgan("combined"));
|
||||||
|
|
||||||
global.server = app.listen(global.db.listenPort, () => {
|
global.server = app.listen(global.argv.listenPort, () => {
|
||||||
console.log(`proxmoxaas-api v${global.api.version} listening on port ${global.db.listenPort}`);
|
console.log(`proxmoxaas-api v${global.api.version} listening on port ${global.argv.listenPort}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
global.utils.recursiveImport(app, "/api", "routes");
|
global.utils.recursiveImport(app, "/api", "routes");
|
||||||
|
Loading…
Reference in New Issue
Block a user