From 7ddafdc600e6a54fbc0d0c60c8f5d041b65752f1 Mon Sep 17 00:00:00 2001 From: JiWoong Sul Date: Mon, 22 Sep 2025 20:31:34 +0900 Subject: [PATCH] =?UTF-8?q?=ED=99=98=EA=B2=BD=20=EB=A1=9C=EB=8D=94=20?= =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=EC=B4=88=EA=B8=B0=ED=99=94=20=EB=B3=B4?= =?UTF-8?q?=EA=B0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/config/environment.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 { } } } -