feat: enhance environment variable handling and security features

This commit is contained in:
CalciumIon
2024-12-30 17:24:19 +08:00
parent bb5e032dd2
commit 2f01a2125f
5 changed files with 16 additions and 3 deletions

View File

@@ -33,9 +33,11 @@ var indexPage []byte
func main() {
err := godotenv.Load(".env")
if err != nil {
common.SysError("failed to load .env file: " + err.Error())
common.SysLog("Support for .env file is disabled")
}
common.LoadEnv()
common.SetupLogger()
common.SysLog("New API " + common.Version + " started")
if os.Getenv("GIN_MODE") != "debug" {