http.go 512 B

12345678910111213141516171819202122232425262728
  1. package http
  2. import (
  3. "go-common/app/job/main/history/conf"
  4. "go-common/app/job/main/history/service"
  5. "go-common/library/log"
  6. bm "go-common/library/net/http/blademaster"
  7. )
  8. var svc *service.Service
  9. // Init http server .
  10. func Init(c *conf.Config, s *service.Service) {
  11. svc = s
  12. engine := bm.DefaultServer(c.BM)
  13. router(engine)
  14. if err := engine.Start(); err != nil {
  15. log.Error("bm.DefaultServer error(%v)", err)
  16. panic(err)
  17. }
  18. }
  19. func router(e *bm.Engine) {
  20. e.Ping(ping)
  21. }
  22. func ping(c *bm.Context) {
  23. }