update env.ts with url beta 0.0.3
This commit is contained in:
@@ -7,7 +7,7 @@ const DEFAULT_SESSION_SECRET =
|
||||
|
||||
const EnvSchema = z.object({
|
||||
// URLs / identification
|
||||
NEXT_PUBLIC_APP_URL: z.string().url().default("http://localhost:3000"),
|
||||
NEXT_PUBLIC_APP_URL: z.string().url().default("https://www.themoyos.za"),
|
||||
|
||||
// Database (optional in dev; required later in prod by runtime check or when you wire Prisma)
|
||||
DATABASE_URL: z.string().url().optional(),
|
||||
@@ -136,15 +136,12 @@ if (isProduction && shouldValidateAtModuleEval) {
|
||||
}
|
||||
}
|
||||
|
||||
// Skip validation during build time (when SKIP_ENV_VALIDATION is set)
|
||||
const skipValidation = process.env.SKIP_ENV_VALIDATION === "1";
|
||||
|
||||
const resolvedAdminPassword =
|
||||
result.data.ADMIN_PASSWORD ??
|
||||
(result.data.NODE_ENV !== "production" || skipValidation ? DEFAULT_ADMIN_PASSWORD : (() => { throw new Error("ADMIN_PASSWORD required in production"); })());
|
||||
(result.data.NODE_ENV !== "production" ? DEFAULT_ADMIN_PASSWORD : (() => { throw new Error("ADMIN_PASSWORD required in production"); })());
|
||||
const resolvedSessionSecret =
|
||||
result.data.SESSION_SECRET ??
|
||||
(result.data.NODE_ENV !== "production" || skipValidation ? DEFAULT_SESSION_SECRET : (() => { throw new Error("SESSION_SECRET required in production"); })());
|
||||
(result.data.NODE_ENV !== "production" ? DEFAULT_SESSION_SECRET : (() => { throw new Error("SESSION_SECRET required in production"); })());
|
||||
|
||||
export const ENV = {
|
||||
APP_URL: result.data.NEXT_PUBLIC_APP_URL,
|
||||
|
||||
Reference in New Issue
Block a user