更新返回code代码
This commit is contained in:
21
main.go
21
main.go
@@ -1,7 +1,24 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"strconv"
|
||||
"toutoukan/config"
|
||||
"toutoukan/init/databaseInit"
|
||||
"toutoukan/init/redisInit"
|
||||
"toutoukan/router"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fmt.Println("hello world")
|
||||
databaseInit.DbInit()
|
||||
redisInit.RedisInit()
|
||||
if err := config.Goinit(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
r := router.SetupRouter()
|
||||
err := r.Run(":" + strconv.Itoa(config.Conf.Port))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer databaseInit.UserDB.Close()
|
||||
defer redisInit.RedisClient.Close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user