feat: add server=side cfg and default theme

This commit is contained in:
Gabe Farrell 2025-11-18 18:14:11 -05:00
parent b1b8498eab
commit a436bf5c2f
8 changed files with 84 additions and 26 deletions

View file

@ -0,0 +1,18 @@
package handlers
import (
"net/http"
"github.com/gabehf/koito/internal/cfg"
"github.com/gabehf/koito/internal/utils"
)
type ServerConfig struct {
DefaultTheme string `json:"default_theme"`
}
func GetCfgHandler() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
utils.WriteJSON(w, http.StatusOK, ServerConfig{DefaultTheme: cfg.DefaultTheme()})
}
}