Refine the rest structure.

This commit is contained in:
zicla
2019-04-26 11:43:54 +08:00
parent c55e8699b4
commit e88930e13a
49 changed files with 201 additions and 183 deletions

View File

@ -5,9 +5,9 @@ import (
_ "github.com/go-sql-driver/mysql"
"log"
"net/http"
"tank/code"
"tank/code/config"
"tank/code/logger"
"tank/code/rest"
)
func main() {
@ -20,10 +20,10 @@ func main() {
config.CONFIG.Init()
//全局运行的上下文
code.CONTEXT.Init()
defer code.CONTEXT.Destroy()
rest.CONTEXT.Init()
defer rest.CONTEXT.Destroy()
http.Handle("/", code.CONTEXT.Router)
http.Handle("/", rest.CONTEXT.Router)
logger.LOGGER.Info("App started at http://localhost:%v", config.CONFIG.ServerPort)