-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
30 lines (27 loc) · 854 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import (
"github.com/astaxie/beego"
"github.com/astaxie/beego/orm"
_ "github.com/astaxie/beego/session/redis"
"github.com/dchest/captcha"
_ "github.com/go-sql-driver/mysql"
"github.com/yakun0622/shop/redis"
_ "github.com/yakun0622/shop/routers"
)
func init() {
//数据库设置
orm.RegisterDataBase("default", "mysql", "hinew:hinew,2017@tcp(139.196.201.45:3306)/hinew")
//orm.RegisterDataBase("default", "mysql", "root:root@tcp(localhost:3306)/sunlinked")
}
func main() {
if beego.BConfig.RunMode == "dev" {
beego.BConfig.WebConfig.DirectoryIndex = true
beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
beego.SetLogFuncCall(true)
beego.BConfig.Log.FileLineNum = true
beego.SetLogger("file", `{"filename":"logs/log.log"}`)
}
//orm.Debug = true
captcha.SetCustomStore(&redis.CaptchaStroe{})
beego.Run()
}