MCPcopy Index your code
hub / github.com/Monibuca/engine / Handle

Method Handle

config/http.go:44–58  ·  view source on GitHub ↗
(path string, f http.Handler)

Source from the content-addressed store, hash-verified

42}
43
44func (config *HTTP) Handle(path string, f http.Handler) {
45 if config.mux == nil {
46 config.mux = http.NewServeMux()
47 }
48 if config.CORS {
49 f = util.CORS(f)
50 }
51 if config.UserName != "" && config.Password != "" {
52 f = util.BasicAuth(config.UserName, config.Password, f)
53 }
54 for _, middleware := range config.middlewares {
55 f = middleware(path, f)
56 }
57 config.mux.Handle(path, f)
58}
59
60func (config *HTTP) GetHTTPConfig() *HTTP {
61 return config

Callers

nothing calls this directly

Calls 3

CORSFunction · 0.92
BasicAuthFunction · 0.92
HandleMethod · 0.65

Tested by

no test coverage detected