mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
baaa58ca0b
add the missing file refactor: remove unused code fix(core): rename interactionSie middleware rename interactionSie middleware fix(core): update context type name update context type name refactor: per review
24 lines
668 B
TypeScript
24 lines
668 B
TypeScript
import { noop } from '@silverhand/essentials';
|
|
import Koa from 'koa';
|
|
|
|
import { configDotEnv } from './env-set/dot-env.js';
|
|
import envSet from './env-set/index.js';
|
|
import initI18n from './i18n/init.js';
|
|
|
|
try {
|
|
await configDotEnv();
|
|
await envSet.load();
|
|
const app = new Koa({
|
|
proxy: envSet.values.trustProxyHeader,
|
|
});
|
|
await initI18n();
|
|
|
|
// Import last until init completed
|
|
const { default: initApp } = await import('./app/init.js');
|
|
await initApp(app);
|
|
} catch (error: unknown) {
|
|
console.error('Error while initializing app:');
|
|
console.error(error);
|
|
|
|
await Promise.all([envSet.poolSafe?.end(), envSet.queryClientSafe?.end()]).catch(noop);
|
|
}
|