()
| 8 | ) |
| 9 | |
| 10 | func InitConfig() { |
| 11 | _ = godotenv.Load(".env") |
| 12 | global.Host = os.Getenv("SERVER_HOST") |
| 13 | if global.Host == "" { |
| 14 | global.Host = "0.0.0.0" |
| 15 | } |
| 16 | global.Port = os.Getenv("SERVER_PORT") |
| 17 | if global.Port == "" { |
| 18 | global.Port = os.Getenv("PORT") |
| 19 | if global.Port == "" { |
| 20 | global.Port = "8080" |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | global.ChinaPrompt = os.Getenv("CHINA_PROMPT") |
| 25 | global.Authorization = os.Getenv("Authorization") |
| 26 | } |