create startup process

create a startup process before the main elysia process starts. aims to check the main program such as env check and so on.
This commit is contained in:
Rafi Arrafif
2025-07-22 10:14:14 +07:00
parent 945caca728
commit 95d85545cd
2 changed files with 42 additions and 2 deletions

View File

@ -1,5 +1,8 @@
import { Elysia } from "elysia";
import { routes } from "./routes";
import { validateEnv } from "./utils/startups/validateEnv";
validateEnv();
const { Elysia } = await import("elysia");
const { routes } = await import("./routes");
const app = new Elysia().use(routes).listen(process.env.PORT || 3000);