gin endless 热重启

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

    r := gin.New()

	r.GET("/", func(c *gin.Context) {
		c.String(200, config.Config.Server.AppId)
	})

	s := endless.NewServer(":8080", r)
	s.BeforeBegin = func(add string) {
		log.Printf("pid is %d", syscall.Getpid())
	}
	err := s.ListenAndServe()
	if err != nil {
		log.Printf("server err: %v", err)
	}

 

转载于:https://my.oschina.net/qiongtaoli/blog/1861110

你可能感兴趣的:(gin endless 热重启)