Refine the context and Try to fix the nil issue.

This commit is contained in:
zicla
2019-04-28 00:36:21 +08:00
parent fa28bbb83f
commit 3ffc4090e0
34 changed files with 246 additions and 167 deletions

View File

@ -23,10 +23,12 @@ func main() {
config.CONFIG.Init()
//全局运行的上下文
rest.CONTEXT.Init()
defer rest.CONTEXT.Destroy()
tankContext := &rest.Context{}
tankContext.Init()
defer tankContext.Destroy()
core.CONTEXT = tankContext
http.Handle("/", rest.CONTEXT.Router)
http.Handle("/", core.CONTEXT)
core.LOGGER.Info("App started at http://localhost:%v", config.CONFIG.ServerPort)