MCPcopy
hub / github.com/kopia/kopia / setupHandlers

Method setupHandlers

cli/command_server_start.go:320–334  ·  view source on GitHub ↗
(srv *server.Server, m *mux.Router)

Source from the content-addressed store, hash-verified

318}
319
320func (c *commandServerStart) setupHandlers(srv *server.Server, m *mux.Router) {
321 if c.serverStartControlAPI {
322 srv.SetupControlAPIHandlers(m)
323 }
324
325 if c.serverStartUI {
326 srv.SetupHTMLUIAPIHandlers(m)
327
328 if c.serverStartHTMLPath != "" {
329 srv.ServeStaticFiles(m, http.Dir(c.serverStartHTMLPath))
330 } else {
331 srv.ServeStaticFiles(m, server.AssetFile())
332 }
333 }
334}
335
336func initPrometheus(m *mux.Router) {
337 m.Handle("/metrics", promhttp.Handler())

Callers 1

runMethod · 0.95

Calls 4

AssetFileFunction · 0.92
ServeStaticFilesMethod · 0.80

Tested by

no test coverage detected