Handle associates "h" to the pair of HTTP method and path pattern.
(meth string, pat Pattern, h HandlerFunc)
| 381 | |
| 382 | // Handle associates "h" to the pair of HTTP method and path pattern. |
| 383 | func (s *ServeMux) Handle(meth string, pat Pattern, h HandlerFunc) { |
| 384 | if len(s.middlewares) > 0 { |
| 385 | h = chainMiddlewares(s.middlewares)(h) |
| 386 | } |
| 387 | s.handlers[meth] = append([]handler{{pat: pat, h: h}}, s.handlers[meth]...) |
| 388 | } |
| 389 | |
| 390 | // HandlePath allows users to configure custom path handlers. |
| 391 | // refer: https://grpc-ecosystem.github.io/grpc-gateway/docs/operations/inject_router/ |