@@ -3,20 +3,24 @@ import { z } from "zod"
33
44const PORT = 6111
55
6+ const domainSchema = z
7+ . string ( )
8+ . default ( `polinet.cc` )
9+ . describe (
10+ "This is the domain to use as shortener. API available at /api and Admin dashboard at /admin"
11+ )
12+
613// coerce is needed for non-string values, because k8s supports only string env
714export const env = createEnv ( {
15+ client : {
16+ NEXT_PUBLIC_DOMAIN : domainSchema ,
17+ } ,
818 server : {
919 PORT : z . coerce . number ( ) . min ( 1 ) . max ( 65535 ) . default ( PORT ) ,
1020 NODE_ENV : z . enum ( [ "development" , "production" ] ) . default ( "development" ) ,
1121 // PUBLIC_URL: z.string().default(`https://polinet.cc`),
1222 // LOG_LEVEL: z.string().default("DEBUG"),
13- DOMAIN : z
14- . string ( )
15- . default ( `polinet.cc` )
16- . describe (
17- "This is the domain to use as shortener. API available at /api and Admin dashboard at /admin"
18- ) ,
19-
23+ DOMAIN : domainSchema ,
2024 DB_HOST : z . string ( ) . min ( 1 ) ,
2125 DB_PORT : z . coerce . number ( ) . min ( 1 ) . max ( 65535 ) . default ( 5432 ) ,
2226 DB_USER : z . string ( ) . min ( 1 ) ,
@@ -28,6 +32,7 @@ export const env = createEnv({
2832 runtimeEnv : {
2933 PORT : process . env . PORT ,
3034 DOMAIN : process . env . DOMAIN ,
35+ NEXT_PUBLIC_DOMAIN : process . env . DOMAIN ,
3136 DB_HOST : process . env . DB_HOST ,
3237 DB_PORT : process . env . DB_PORT ,
3338 DB_USER : process . env . DB_USER ,
0 commit comments