mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-27 00:40:58 +01:00
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
import { createEnv } from "@t3-oss/env-nextjs";
|
|
import { z } from "zod";
|
|
|
|
export const env = createEnv({
|
|
shared: {
|
|
VERCEL_URL: z
|
|
.string()
|
|
.optional()
|
|
.transform((v) => (v ? `https://${v}` : undefined)),
|
|
PORT: z.coerce.number().default(3000),
|
|
},
|
|
/**
|
|
* Specify your server-side environment variables schema here. This way you can ensure the app isn't
|
|
* built with invalid env vars.
|
|
*/
|
|
server: {
|
|
DB_URL: z.string(),
|
|
},
|
|
/**
|
|
* Specify your client-side environment variables schema here.
|
|
* For them to be exposed to the client, prefix them with `NEXT_PUBLIC_`.
|
|
*/
|
|
client: {
|
|
// NEXT_PUBLIC_CLIENTVAR: z.string(),
|
|
},
|
|
/**
|
|
* Destructure all variables from `process.env` to make sure they aren't tree-shaken away.
|
|
*/
|
|
runtimeEnv: {
|
|
VERCEL_URL: process.env.VERCEL_URL,
|
|
PORT: process.env.PORT,
|
|
DB_URL: process.env.DB_URL,
|
|
// NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,
|
|
},
|
|
skipValidation:
|
|
!!process.env.CI ||
|
|
!!process.env.SKIP_ENV_VALIDATION ||
|
|
process.env.npm_lifecycle_event === "lint",
|
|
});
|