setup application, server, and configs
This commit is contained in:
20
src/configs/_env.ts
Normal file
20
src/configs/_env.ts
Normal 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);
|
||||
Reference in New Issue
Block a user