Try to refine the panic things.

This commit is contained in:
zicla
2018-11-30 17:37:52 +08:00
parent 6485e3b48e
commit b55a993b35
10 changed files with 84 additions and 90 deletions

View File

@ -20,13 +20,12 @@ func main() {
//全局运行的上下文
rest.CONTEXT.Init()
defer rest.CONTEXT.Destroy()
http.Handle("/", rest.CONTEXT.Router)
dotPort := fmt.Sprintf(":%v", rest.CONFIG.ServerPort)
http.Handle("/", rest.CONTEXT.Router)
rest.LOGGER.Info("App started at http://localhost:%v", rest.CONFIG.ServerPort)
dotPort := fmt.Sprintf(":%v", rest.CONFIG.ServerPort)
err1 := http.ListenAndServe(dotPort, nil)
if err1 != nil {
log.Fatal("ListenAndServe: ", err1)