mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
Adding domain to env
This commit is contained in:
parent
51c06f1595
commit
e48d937d6e
2 changed files with 3 additions and 16 deletions
|
|
@ -1,23 +1,9 @@
|
||||||
import env from './env'
|
import env from './env'
|
||||||
import type { Config } from './types/config'
|
import type { Config } from './types/config'
|
||||||
|
|
||||||
const isPreview = process.env.VERCEL_ENV === 'preview' || process.env.VERCEL_ENV === 'development'
|
|
||||||
|
|
||||||
let domain: string
|
|
||||||
if (process.env.NODE_ENV === 'production' || process.env.VERCEL_ENV === 'production') {
|
|
||||||
domain = 'boredgame.vercel.app'
|
|
||||||
} else if (isPreview && process.env.VERCEL_BRANCH_URL !== undefined) {
|
|
||||||
domain = process.env.VERCEL_BRANCH_URL
|
|
||||||
} else {
|
|
||||||
domain = 'localhost'
|
|
||||||
}
|
|
||||||
|
|
||||||
// export const config = { ...env, isProduction: process.env.NODE_ENV === 'production'
|
|
||||||
// || process.env.VERCEL_ENV === 'production', domain };
|
|
||||||
|
|
||||||
export const config: Config = {
|
export const config: Config = {
|
||||||
isProduction: process.env.NODE_ENV === 'production' || process.env.VERCEL_ENV === 'production',
|
isProduction: process.env.NODE_ENV === 'production',
|
||||||
domain,
|
domain: env.DOMAIN,
|
||||||
api: {
|
api: {
|
||||||
origin: env.ORIGIN,
|
origin: env.ORIGIN,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ const EnvSchema = z.object({
|
||||||
DATABASE_DB: z.string(),
|
DATABASE_DB: z.string(),
|
||||||
DB_MIGRATING: stringBoolean,
|
DB_MIGRATING: stringBoolean,
|
||||||
DB_SEEDING: stringBoolean,
|
DB_SEEDING: stringBoolean,
|
||||||
|
DOMAIN: z.string(),
|
||||||
GITHUB_CLIENT_ID: z.string(),
|
GITHUB_CLIENT_ID: z.string(),
|
||||||
GITHUB_CLIENT_SECRET: z.string(),
|
GITHUB_CLIENT_SECRET: z.string(),
|
||||||
GOOGLE_CLIENT_ID: z.string(),
|
GOOGLE_CLIENT_ID: z.string(),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue