Get handles GET /settings.
(w http.ResponseWriter, r *http.Request)
| 44 | |
| 45 | // Get handles GET /settings. |
| 46 | func (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). |
| 56 | func (h *SettingsHandler) GetServerURL(w http.ResponseWriter, r *http.Request) { |
no test coverage detected