Commit e1faaea6 by Li Feifei

使用环境变量

parent 154468d2
Pipeline #15866 passed with stages
in 34 seconds
package boot
import (
"fmt"
"github.com/gogf/gf/frame/g"
"github.com/gogf/gf/net/ghttp"
"os"
)
func init() {
link := fmt.Sprintf("mysql:%s:%s@tcp(%s:3306)/xyu",
os.Getenv("read_user"),
os.Getenv("read_pass"),
os.Getenv("read_sql"))
_ = g.Config().Set("database.link", link)
g.Server().SetNameToUriType(ghttp.URI_TYPE_CAMEL)
g.Log().SetAsync(true)
......
......@@ -28,7 +28,6 @@
# Database.
[database]
link = "mysql:video:vlty&AxMwT$lmLv6bN8dkDuBYlh%N5pe@tcp(rm-2zevlk47ul0ovuci80o.mysql.rds.aliyuncs.com:3306)/xyu"
debug = false
# Database logger.
[database.logger]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment