feat: implement type-safe environment configuration and add .env.example files for web and landing apps
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
VITE_CMS_API_URL=http://localhost:8001/cms
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
/**
|
||||||
|
* Type-safe Environment Wrapper for apps/landing.
|
||||||
|
*/
|
||||||
|
export const ENV = {
|
||||||
|
CMS_API_URL: import.meta.env.VITE_CMS_API_URL || 'http://localhost:8001/cms',
|
||||||
|
} as const;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
VITE_API_BASE_URL=http://localhost:8000/api
|
||||||
|
VITE_APP_ENV=development
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
/**
|
||||||
|
* Type-safe Environment Wrapper for apps/web.
|
||||||
|
* DO NOT use `import.meta.env` directly in components. Import this `ENV` object instead.
|
||||||
|
*/
|
||||||
|
export const ENV = {
|
||||||
|
API_BASE_URL: import.meta.env.VITE_API_BASE_URL || 'http://localhost:8000/api',
|
||||||
|
APP_ENV: (import.meta.env.VITE_APP_ENV || 'development') as 'development' | 'staging' | 'production',
|
||||||
|
IS_PROD: import.meta.env.VITE_APP_ENV === 'production',
|
||||||
|
} as const;
|
||||||
|
|
||||||
Reference in New Issue
Block a user