zerobyte/app/server/modules/lifecycle/bootstrap.ts
Nicolas Meienberger af7a1b6249 refactor: remove proxy pattern for db and auth
Since we migrated away from rr this is not needed anymore as the bundler
correctly split chunks
2026-02-13 21:11:00 +01:00

24 lines
500 B
TypeScript

import { runDbMigrations } from "../../db/db";
import { runMigrations } from "./migrations";
import { startup } from "./startup";
let bootstrapPromise: Promise<void> | undefined;
const runBootstrap = async () => {
runDbMigrations();
await runMigrations();
await startup();
};
export const bootstrapApplication = async () => {
if (!bootstrapPromise) {
bootstrapPromise = runBootstrap();
}
try {
await bootstrapPromise;
} catch (err) {
bootstrapPromise = undefined;
throw err;
}
};