同步
This commit is contained in:
@@ -6,7 +6,7 @@ GIN_MODE=debug
|
||||
APP_VERSION=0.0.0
|
||||
|
||||
# 数据库(与 Next 现网一致:腾讯云 CDB soul_miniprogram)
|
||||
DB_DSN=cdb_outerroot:Zhiqun1984@tcp(56b4c23f6853c.gz.cdb.myqcloud.com:14413)/soul_miniprogram?charset=utf8mb4&parseTime=True
|
||||
DB_DSN=souldev:RXW2FeRcRdH2GtXy@tcp(56b4c23f6853c.gz.cdb.myqcloud.com:14413)/souldev?charset=utf8mb4&parseTime=True
|
||||
|
||||
# 微信小程序配置
|
||||
WECHAT_APPID=wxb8bbb2b10dec74aa
|
||||
|
||||
@@ -6,7 +6,7 @@ GIN_MODE=debug
|
||||
APP_VERSION=0.0.0
|
||||
|
||||
# 数据库(与 Next 现网一致:腾讯云 CDB soul_miniprogram)
|
||||
DB_DSN=cdb_outerroot:Zhiqun1984@tcp(56b4c23f6853c.gz.cdb.myqcloud.com:14413)/soul_miniprogram?charset=utf8mb4&parseTime=True
|
||||
DB_DSN=souldev:RXW2FeRcRdH2GtXy@tcp(56b4c23f6853c.gz.cdb.myqcloud.com:14413)/souldev?charset=utf8mb4&parseTime=True
|
||||
|
||||
# 微信小程序配置
|
||||
WECHAT_APPID=wxb8bbb2b10dec74aa
|
||||
|
||||
@@ -75,12 +75,17 @@ func parseCORSOrigins() []string {
|
||||
return origins
|
||||
}
|
||||
|
||||
// Load 加载配置,端口等从 .env 读取。优先从可执行文件同目录加载 .env,再试当前目录
|
||||
// Load 加载配置,端口等从 env 文件读取。
|
||||
// 通过 ENV_FILE 选择:.env.development(默认)或 .env.production;Air 运行时可用 ENV_FILE=.env.production air 切换
|
||||
func Load() (*Config, error) {
|
||||
if execPath, err := os.Executable(); err == nil {
|
||||
_ = godotenv.Load(filepath.Join(filepath.Dir(execPath), ".env"))
|
||||
envFile := os.Getenv("ENV_FILE")
|
||||
if envFile == "" {
|
||||
envFile = ".env.development"
|
||||
}
|
||||
_ = godotenv.Load(".env")
|
||||
if execPath, err := os.Executable(); err == nil {
|
||||
_ = godotenv.Load(filepath.Join(filepath.Dir(execPath), envFile))
|
||||
}
|
||||
_ = godotenv.Load(envFile)
|
||||
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
|
||||
Reference in New Issue
Block a user