http.go 548 B

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