简化API节点的数据库配置(db.yaml)

This commit is contained in:
GoEdgeLab
2024-05-06 17:29:11 +08:00
parent d8e9268dab
commit a573eb5608
8 changed files with 223 additions and 91 deletions

View File

@@ -25,7 +25,7 @@ func (this *InstallAction) RunGet(params struct {
this.ErrorPage(err)
return
}
node := nodeResp.ApiNode
var node = nodeResp.ApiNode
if node == nil {
this.NotFound("apiNode", params.NodeId)
return
@@ -39,12 +39,12 @@ func (this *InstallAction) RunGet(params struct {
}
// 数据库配置
dbConfigMap := maps.Map{
var dbConfigMap = maps.Map{
"config": "",
"error": "",
"isNotFound": false,
}
dbConfigFile := Tea.ConfigFile("api_db.yaml")
var dbConfigFile = Tea.ConfigFile("api_db.yaml")
data, err := os.ReadFile(dbConfigFile)
dbConfigMap["config"] = string(data)
if err != nil {