소스 검색

feat: api key env

Yeuoly 1 년 전
부모
커밋
1c8326a716
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      internal/static/config.go

+ 5 - 0
internal/static/config.go

@@ -48,6 +48,11 @@ func InitConfig(path string) error {
 		difySandboxGlobalConfigurations.WorkerTimeout, _ = strconv.Atoi(timeout)
 	}
 
+	api_key := os.Getenv("API_KEY")
+	if api_key != "" {
+		difySandboxGlobalConfigurations.App.Key = api_key
+	}
+
 	return nil
 }