setup application, server, and configs

This commit is contained in:
ItsMalma
2025-11-03 21:28:16 +07:00
parent 2769bdd894
commit 9aa0de17ee
12 changed files with 182 additions and 17 deletions

20
src/configs/_env.ts Normal file
View File

@@ -0,0 +1,20 @@
import z from "zod";
export const _env = z
.object({
SERVER_HOST: z.string("Must be string."),
SERVER_PORT: z.coerce
.number("Must be number.")
.int("Must be integer.")
.min(0, "Min 0."),
DATABASE_HOST: z.string("Must be string.").nonempty("Must not empty."),
DATABASE_PORT: z.coerce
.number("Must be number.")
.int("Must be integer.")
.min(0, "Min 0."),
DATABASE_USERNAME: z.string("Must be string.").nonempty("Must not empty."),
DATABASE_PASSWORD: z.string("Must be string.").nonempty("Must not empty."),
DATABASE_NAME: z.string("Must be string.").nonempty("Must not empty."),
})
.parse(Bun.env);