0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00
logto/packages/core/src/index.ts

32 lines
772 B
TypeScript
Raw Normal View History

import 'module-alias/register';
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
// eslint-disable-next-line import/order
import { configDotEnv } from './env-set/dot-env';
configDotEnv();
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';
import { initConnectors } from './connectors';
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
// Update after we migrate to ESM
// eslint-disable-next-line unicorn/prefer-top-level-await
2021-06-27 20:44:05 +08:00
(async () => {
try {
await envSet.load();
const app = new Koa({
2022-05-05 22:39:28 +08:00
proxy: envSet.values.trustProxyHeader,
});
await initConnectors();
await initI18n();
await initApp(app);
2021-06-27 20:44:05 +08:00
} catch (error: unknown) {
console.log('Error while initializing app', error);
}
})();