engine.go 523 Bytes
package handler

import (
	"github.com/meiqia/chi"
	chi_middleware "github.com/meiqia/chi/middleware"

	"client/gift/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/gift", func(r chi.Router) {
		r.Get("/ping", PingHandler)
		r.Post("/exchange", GetGiftContent)
		r.Get("/test_get_content", TestGetGiftFunc)
	})
}