Skip to content

Commit

Permalink
fix(apps/kampus): change KAMPUS_ENV to be a public env var (#698)
Browse files Browse the repository at this point in the history
fala nfilan
  • Loading branch information
usirin authored Sep 2, 2023
1 parent f8aa353 commit 241a6d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion apps/kampus/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# update with the url after running `npm run dev` under `apps/gql`
NEXT_PUBLIC_GQL_URL=http://gql.localhost.kamp.us:4000/graphql
NEXT_PUBLIC_KAMPUS_ENV=localhost

NEXTAUTH_URL=http://pasaport.localhost.kamp.us:3001/auth
RESEND_API_KEY="get-your-own-resend-api-key"
KAMPUS_ENV=development
2 changes: 1 addition & 1 deletion apps/kampus/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const env = parseEnv(
GQL_URL: process.env.NEXT_PUBLIC_GQL_URL,
RESEND_API_KEY: process.env.RESEND_API_KEY,
NEXTAUTH_URL: process.env.NEXTAUTH_URL,
KAMPUS_ENV: process.env.KAMPUS_ENV ?? process.env.VERCEL_URL,
KAMPUS_ENV: process.env.NEXT_PUBLIC_KAMPUS_ENV ?? process.env.VERCEL_URL,
},
{
NODE_ENV: z.enum(["development", "test", "production"]),
Expand Down
9 changes: 8 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,14 @@
"dependsOn": ["@kampus/prisma#prisma:generate", "@kampus/sozluk-content#build"]
},
"@kampus-apps/kampus#*": {
"env": ["NODE_ENV", "NEXT_PUBLIC_GQL_URL", "RESEND_API_KEY", "NEXTAUTH_URL", "KAMPUS_ENV", "VERCEL_URL"]
"env": [
"NODE_ENV",
"NEXT_PUBLIC_GQL_URL",
"RESEND_API_KEY",
"NEXTAUTH_URL",
"NEXT_PUBLIC_KAMPUS_ENV",
"VERCEL_URL"
]
},
"@kampus-apps/pasaport#*": {
"env": ["NODE_ENV", "NEXTAUTH_URL", "DATABASE_URL", "KAMPUS_ENV"]
Expand Down

0 comments on commit 241a6d5

Please sign in to comment.