internal/api/config.go (view raw)
1package api
2
3import "net/http"
4
5func (a *API) HandleConfig(w http.ResponseWriter, r *http.Request) {
6 resp := map[string]any{
7 "site_title": a.Cfg.Server.SiteTitle,
8 }
9
10 if a.Cfg.Server.FaviconPath != "" {
11 resp["favicon_url"] = "/favicon"
12 }
13 if a.Cfg.Server.LogoPath != "" {
14 resp["logo_url"] = "/logo"
15 }
16
17 writeJSON(w, http.StatusOK, resp)
18}