new(core.gbapp): New API endpoint.
This commit is contained in:
parent
7c208954f3
commit
edb50e3b13
1 changed files with 43 additions and 44 deletions
31
src/app.ts
31
src/app.ts
|
@ -114,7 +114,7 @@ export class GBServer {
|
||||||
process.on('uncaughtException', (err, p) => {
|
process.on('uncaughtException', (err, p) => {
|
||||||
if (err !== null) {
|
if (err !== null) {
|
||||||
err = err['e'] ? err['e'] : err;
|
err = err['e'] ? err['e'] : err;
|
||||||
const msg = `${err['code'] ? err['code'] : ''} ${err?.['response']?.['data'] ? err?.['response']?.['data'] : ''} ${err.message ? err.message : ''} ${err['description'] ? err['description'] : ''}`
|
const msg = `${err['code'] ? err['code'] : ''} ${err?.['response']?.['data'] ? err?.['response']?.['data']: ''} ${err.message ? err.message : ''} ${err['description'] ? err['description'] : ''}`
|
||||||
GBLog.error(`UNCAUGHT_EXCEPTION: ${err.toString()} ${err['stack'] ? '\n' + err['stack'] : ''} ${msg}`);
|
GBLog.error(`UNCAUGHT_EXCEPTION: ${err.toString()} ${err['stack'] ? '\n' + err['stack'] : ''} ${msg}`);
|
||||||
} else {
|
} else {
|
||||||
GBLog.error('UNCAUGHT_EXCEPTION: Unknown error (err is null)');
|
GBLog.error('UNCAUGHT_EXCEPTION: Unknown error (err is null)');
|
||||||
|
@ -298,6 +298,20 @@ export class GBServer {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
GBLog.info(`The Bot Server is in RUNNING mode...`);
|
||||||
|
|
||||||
|
// Opens Navigator.
|
||||||
|
|
||||||
|
if (process.env.DEV_OPEN_BROWSER) {
|
||||||
|
core.openBrowserInDevelopment();
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
GBLog.error(`STOP: ${err.message ? err.message : err} ${err.stack ? err.stack : ''}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
};
|
||||||
|
|
||||||
// Setups unsecure http redirect.
|
// Setups unsecure http redirect.
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'production') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
@ -340,21 +354,6 @@ export class GBServer {
|
||||||
else {
|
else {
|
||||||
server.listen(port, mainCallback);
|
server.listen(port, mainCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
GBLog.info(`The Bot Server is in RUNNING mode...`);
|
|
||||||
|
|
||||||
// Opens Navigator.
|
|
||||||
|
|
||||||
if (process.env.DEV_OPEN_BROWSER) {
|
|
||||||
core.openBrowserInDevelopment();
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
GBLog.error(`STOP: ${err.message ? err.message : err} ${err.stack ? err.stack : ''}`);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static initEndpointsDocs(app: express.Application) {
|
public static initEndpointsDocs(app: express.Application) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue