Try to abstract the context entity.

This commit is contained in:
zicla
2018-11-29 17:34:53 +08:00
parent fcdcf6da60
commit 0d918fbb69
6 changed files with 80 additions and 52 deletions

View File

@ -12,10 +12,11 @@ func main() {
//将运行时参数装填到config中去。
rest.PrepareConfigs()
context := rest.NewContext()
defer context.Destroy()
http.Handle("/", context.Router)
rest.CONTEXT.Init()
defer rest.CONTEXT.Destroy()
http.Handle("/", rest.CONTEXT.Router)
dotPort := fmt.Sprintf(":%v", rest.CONFIG.ServerPort)