Skip to content

Commit bd1f880

Browse files
committed
fix(api): correct dotenv initialization and usage
Updates the `dotenv` usage to correctly instantiate the `DotEnv` class and call the `load()` method on the instance, as per the package's documentation. This ensures that environment variables from the .env file are properly loaded into the application's environment.
1 parent cd940ef commit bd1f880

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/src/config/app_dependencies.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import 'dart:async';
22

3-
import 'package:dotenv/dotenv.dart' as dotenv;
3+
import 'package:dotenv/dotenv.dart';
44
import 'package:ht_api/src/config/database_connection.dart';
55
import 'package:ht_api/src/rbac/permission_service.dart';
66
import 'package:ht_api/src/services/auth_service.dart';
@@ -84,7 +84,7 @@ class AppDependencies {
8484

8585
Future<void> _init() async {
8686
// 0. Load environment variables from .env file.
87-
dotenv.load();
87+
DotEnv(includePlatformEnvironment: true).load();
8888
_log.info('Environment variables loaded from .env file.');
8989

9090
// 1. Establish Database Connection.

0 commit comments

Comments
 (0)