api_debug_route.go 418 B

1234567891011121314151617181920212223
  1. package route
  2. import (
  3. "kpt-grpc-demo/http/api"
  4. "kpt-grpc-demo/http/debug"
  5. "github.com/gin-gonic/gin"
  6. )
  7. func DebugAPI(opts ...func(engine *gin.Engine)) func(s *gin.Engine) {
  8. return func(s *gin.Engine) {
  9. for _, opt := range opts {
  10. opt(s)
  11. }
  12. // Not Found
  13. s.NoRoute(api.Handle404)
  14. debugRoute := authRouteGroup(s, "/api/v1/kpt/debug/")
  15. // kpt debug api
  16. debugRoute.GET("hello", debug.HelloOk)
  17. }
  18. }