diff --git a/lib/core/config/environment.dart b/lib/core/config/environment.dart index a5b64a9..da14037 100644 --- a/lib/core/config/environment.dart +++ b/lib/core/config/environment.dart @@ -28,8 +28,10 @@ class Environment { isProduction = envName == 'production'; final fileName = '.env.$envName'; + var initialized = false; try { await dotenv.load(fileName: fileName); + initialized = true; } catch (e) { if (kDebugMode) { // 개발 편의를 위해 파일 미존재 시 경고만 출력하고 진행 @@ -39,6 +41,10 @@ class Environment { } } + if (!initialized) { + dotenv.testLoad(); + } + baseUrl = dotenv.maybeGet('API_BASE_URL') ?? 'http://localhost:8080'; } @@ -62,4 +68,3 @@ class Environment { } } } -