2021-07-11 17:59:44 +08:00
|
|
|
import 'module-alias/register.js';
|
2021-07-02 22:55:14 +08:00
|
|
|
|
2021-08-30 11:30:54 +08:00
|
|
|
import Koa from 'koa';
|
2021-07-11 17:59:44 +08:00
|
|
|
|
2022-04-24 12:12:48 +08:00
|
|
|
// eslint-disable-next-line import/order
|
|
|
|
import { configDotEnv } from './env-set/dot-env';
|
|
|
|
|
|
|
|
configDotEnv();
|
2021-12-29 11:56:55 +08:00
|
|
|
|
2022-01-27 19:26:34 +08:00
|
|
|
/* eslint-disable import/first */
|
2021-08-11 22:37:21 +08:00
|
|
|
import initApp from './app/init';
|
2022-01-11 16:26:54 +08:00
|
|
|
import { initConnectors } from './connectors';
|
2022-04-20 14:14:37 +08:00
|
|
|
import envSet from './env-set';
|
2021-08-30 11:30:54 +08:00
|
|
|
import initI18n from './i18n/init';
|
2022-01-27 19:26:34 +08:00
|
|
|
/* eslint-enable import/first */
|
2021-06-06 18:30:37 +08:00
|
|
|
|
2021-06-27 20:44:05 +08:00
|
|
|
(async () => {
|
|
|
|
try {
|
2022-04-19 21:49:20 +08:00
|
|
|
await envSet.load();
|
2022-04-20 14:14:37 +08:00
|
|
|
const app = new Koa({
|
2022-05-05 22:39:28 +08:00
|
|
|
proxy: envSet.values.trustProxyHeader,
|
2022-04-20 14:14:37 +08:00
|
|
|
});
|
2022-01-11 16:26:54 +08:00
|
|
|
await initConnectors();
|
2021-07-28 01:13:51 +08:00
|
|
|
await initI18n();
|
2021-07-09 23:25:24 +08:00
|
|
|
await initApp(app);
|
2021-06-27 20:44:05 +08:00
|
|
|
} catch (error: unknown) {
|
|
|
|
console.log('Error while initializing app', error);
|
|
|
|
}
|
|
|
|
})();
|