feat: implement type-safe environment configuration and add .env.example files for web and landing apps

This commit is contained in:
Firman Ramdhani
2026-05-29 13:43:31 +07:00
parent d52e403474
commit 86c02e7111
4 changed files with 19 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
VITE_CMS_API_URL=http://localhost:8001/cms
+6
View File
@@ -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;
+2
View File
@@ -0,0 +1,2 @@
VITE_API_BASE_URL=http://localhost:8000/api
VITE_APP_ENV=development
+10
View File
@@ -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;