forked from galtproject/geesome-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
33 lines (28 loc) · 1012 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* Copyright ©️ 2018-2020 Galt•Project Society Construction and Terraforming Company
* (Founded by [Nikolai Popeka](https://github.com/npopeka)
*
* Copyright ©️ 2018-2020 Galt•Core Blockchain Company
* (Founded by [Nikolai Popeka](https://github.com/npopeka) by
* [Basic Agreement](ipfs/QmaCiXUmSrP16Gz8Jdzq6AJESY1EAANmmwha15uR3c1bsS)).
*/
import {IGeesomeApp} from "./app/interface";
(async () => {
const databaseConfig: any = {};
if (process.env.DATABASE_NAME) {
databaseConfig.name = process.env.DATABASE_NAME;
}
const storageConfig: any = {};
if (process.env.STORAGE_REPO) {
storageConfig.repo = process.env.STORAGE_REPO;
}
const app: IGeesomeApp = await require('./app')({
databaseConfig,
storageConfig: {jsNode: storageConfig, goNode: storageConfig}
});
require('./publish-docs')(app);
})();
process.on('uncaughtException', (err) => {
console.error('There was an uncaught error', err);
// process.exit(1) //mandatory (as per the Node docs)
});