MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / Get

Method Get

server-source-code/internal/handler/settings.go:46–53  ·  view source on GitHub ↗

Get handles GET /settings.

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

44
45// Get handles GET /settings.
46func (h *SettingsHandler) Get(w http.ResponseWriter, r *http.Request) {
47 s, err := h.settings.GetFirst(r.Context())
48 if err != nil {
49 Error(w, http.StatusInternalServerError, "Failed to load settings")
50 return
51 }
52 JSON(w, http.StatusOK, settingsToResponse(s, h.enc))
53}
54
55// GetServerURL handles GET /settings/server-url (public, used by install commands and Add Host wizard).
56func (h *SettingsHandler) GetServerURL(w http.ResponseWriter, r *http.Request) {

Callers 1

GetCurrentURLMethod · 0.45

Calls 4

ErrorFunction · 0.85
settingsToResponseFunction · 0.85
GetFirstMethod · 0.80
JSONFunction · 0.70

Tested by

no test coverage detected