api & web: ports in env are no longer strictly required
This commit is contained in:
@@ -21,8 +21,8 @@ app.disable('x-powered-by');
|
||||
|
||||
await loadLoc();
|
||||
|
||||
const apiMode = process.env.apiURL && process.env.apiPort && !((process.env.webURL && process.env.webPort) || (process.env.selfURL && process.env.port));
|
||||
const webMode = process.env.webURL && process.env.webPort && !((process.env.apiURL && process.env.apiPort) || (process.env.selfURL && process.env.port));
|
||||
const apiMode = process.env.apiURL && !process.env.webURL;
|
||||
const webMode = process.env.webURL && !process.env.apiURL;
|
||||
|
||||
if (apiMode) {
|
||||
const { runAPI } = await import('./core/api.js');
|
||||
@@ -31,5 +31,9 @@ if (apiMode) {
|
||||
const { runWeb } = await import('./core/web.js');
|
||||
await runWeb(express, app, gitCommit, gitBranch, __dirname)
|
||||
} else {
|
||||
console.log(Red(`cobalt wasn't configured yet or configuration is invalid.\n`) + Bright(`please run the setup script to fix this: `) + Green(`npm run setup`))
|
||||
console.log(
|
||||
Red(`cobalt wasn't configured yet or configuration is invalid.\n`)
|
||||
+ Bright(`please run the setup script to fix this: `)
|
||||
+ Green(`npm run setup`)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user