fix(core.gbapp): Entire Web stack is optional now.
This commit is contained in:
parent
b6e3611636
commit
9652fcdb0b
3 changed files with 15 additions and 10 deletions
|
@ -131,12 +131,15 @@ export class GBConfigService {
|
|||
value = 'true';
|
||||
break;
|
||||
case 'REVERSE_PROXY':
|
||||
value = undefined;
|
||||
break;
|
||||
value = undefined;
|
||||
break;
|
||||
case 'DISABLE_WEB':
|
||||
value = "false";
|
||||
break;
|
||||
case 'STORAGE_ACQUIRE_TIMEOUT':
|
||||
value = 40000;
|
||||
break;
|
||||
default:
|
||||
value = 40000;
|
||||
break;
|
||||
default:
|
||||
GBLog.warn(`Invalid key on .env file: '${key}'`);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ export class GBImporter {
|
|||
}
|
||||
const instance = await this.core.loadInstance(botId);
|
||||
|
||||
if (instance != null || instance.botId === null) {
|
||||
if (instance != null && instance.botId === null) {
|
||||
console.log(`Null BotId after load instance with botId: ${botId}.`);
|
||||
}
|
||||
|
||||
|
|
10
src/app.ts
10
src/app.ts
|
@ -115,7 +115,7 @@ export class GBServer {
|
|||
const deployer: GBDeployer = new GBDeployer(core, importer);
|
||||
const azureDeployer: AzureDeployerService = new AzureDeployerService(deployer);
|
||||
const adminService: GBAdminService = new GBAdminService(core);
|
||||
|
||||
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
const proxy = GBConfigService.get('REVERSE_PROXY');
|
||||
|
@ -167,14 +167,14 @@ export class GBServer {
|
|||
const fullInstance = Object.assign(packageInstance, GBServer.globals.bootInstance);
|
||||
await core.saveInstance(fullInstance);
|
||||
let instances: IGBInstance[] = await core.loadAllInstances(core, azureDeployer,
|
||||
GBServer.globals.publicAddress);
|
||||
GBServer.globals.publicAddress);
|
||||
instances = await core.ensureInstances(instances, GBServer.globals.bootInstance, core);
|
||||
if (GBServer.globals.bootInstance !== undefined) {
|
||||
GBServer.globals.bootInstance = instances[0];
|
||||
}
|
||||
|
||||
// Builds minimal service infrastructure.
|
||||
|
||||
|
||||
const conversationalService: GBConversationalService = new GBConversationalService(core);
|
||||
const minService: GBMinService = new GBMinService(core, conversationalService, adminService, deployer);
|
||||
GBServer.globals.minService = minService;
|
||||
|
@ -182,7 +182,9 @@ export class GBServer {
|
|||
|
||||
// Deployment of local applications for the first time.
|
||||
|
||||
deployer.setupDefaultGBUI();
|
||||
if (GBConfigService.get("DISABLE_WEB") !== "true") {
|
||||
deployer.setupDefaultGBUI();
|
||||
}
|
||||
|
||||
GBLog.info(`The Bot Server is in RUNNING mode...`);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue