MCPcopy
hub / github.com/go-chi/chi / RouteHeaders

Function RouteHeaders

middleware/route_headers.go:42–44  ·  view source on GitHub ↗

RouteHeaders is a neat little header-based router that allows you to direct the flow of a request through a middleware stack based on a request header. For example, lets say you'd like to setup multiple routers depending on the request Host header, you could then do something as so: r := chi.NewR

()

Source from the content-addressed store, hash-verified

40// })).
41// Handler)
42func RouteHeaders() HeaderRouter {
43 return HeaderRouter{}
44}
45
46type HeaderRouter map[string][]HeaderRoute
47

Callers 1

TestRouteHeadersFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestRouteHeadersFunction · 0.68