engine.go
485 Bytes
package handler
import (
"github.com/meiqia/chi"
chi_middleware "github.com/meiqia/chi/middleware"
"client/bulletin/middleware"
)
func BugInfoEngine() chi.Router {
router := chi.NewRouter()
router.Use(middleware.Recovery)
router.Use(chi_middleware.StripSlashes)
registerV1Router(router)
return router
}
func registerV1Router(router chi.Router) {
router.Route("/v1/bulletin", func(r chi.Router) {
r.Get("/ping", PingHandler)
r.Get("/get_bulletin", GetBulletin)
})
}