diff options
| author | Ali Golzar <57574919+aliglzr@users.noreply.github.com> | 2025-05-17 13:33:22 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-17 13:33:22 +0300 |
| commit | 1b1cbfff422e6de58a6f524336b19ec809eb45f0 (patch) | |
| tree | e0637ad401b23fa151e9e7d68bf48f57d03668aa /main.go | |
| parent | c93467b85290a15b55c7fa3dde99e2c383a4829e (diff) | |
feat: support .env file (#3013)
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -13,11 +13,12 @@ import ( "x-ui/database" "x-ui/logger" "x-ui/sub" + "x-ui/util/crypto" "x-ui/web" "x-ui/web/global" "x-ui/web/service" - "x-ui/util/crypto" + "github.com/joho/godotenv" "github.com/op/go-logging" ) @@ -39,6 +40,8 @@ func runWebServer() { log.Fatalf("Unknown log level: %v", config.GetLogLevel()) } + godotenv.Load() + err := database.InitDB(config.GetDBPath()) if err != nil { log.Fatalf("Error initializing database: %v", err) |
