Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request ThingsPanel#251 from November-12/main
Browse files Browse the repository at this point in the history
add config
  • Loading branch information
November-12 authored Nov 3, 2023
2 parents 83e1dbc + 9f7ab43 commit 3838ff3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion conf/app.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
app:
runmode: prod
httpport: 127.0.0.1:9999

log:
# 0-控制台输出 1-文件输出 2-文件和控制台输出
adapter_type: 0
# 文件最多保存多少天
maxdays: 7
# 日志级别 (0-紧急 1-报警 2-严重错误 3-错误 4-警告 5-注意 6-信息 7-调试)
level: 4
level: 7
# 每个文件保存的最大行数
maxlines: 10000

Expand Down
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
_ "ThingsPanel-Go/initialize/psql"

beego "github.com/beego/beego/v2/server/web"
"github.com/spf13/viper"

_ "ThingsPanel-Go/modules/dataService"

Expand Down Expand Up @@ -76,6 +77,9 @@ func main() {
beego.BConfig.CopyRequestBody = true
beego.BConfig.WebConfig.Session.SessionOn = true
beego.BConfig.WebConfig.AutoRender = false
beego.BConfig.AppName = "ThingsPanel-Go"

beego.Run(":9999")
beego.BConfig.RunMode = viper.GetString("app.runmode")
httpport := viper.GetString("app.httpport")
beego.Run(httpport)
}

0 comments on commit 3838ff3

Please sign in to comment.