http.go 433 B

12345678910111213141516171819202122232425
  1. package http
  2. import (
  3. "go-common/app/interface/main/broadcast/conf"
  4. "go-common/library/log"
  5. bm "go-common/library/net/http/blademaster"
  6. )
  7. // Init init http.
  8. func Init(c *conf.Config) {
  9. engine := bm.DefaultServer(c.HTTP)
  10. outerRouter(engine)
  11. if err := engine.Start(); err != nil {
  12. log.Error("bm.DefaultServer error(%v)", err)
  13. panic(err)
  14. }
  15. }
  16. func outerRouter(e *bm.Engine) {
  17. e.Ping(ping)
  18. }
  19. func ping(c *bm.Context) {
  20. }