mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-22 20:11:50 -07:00
23 lines
469 B
Go
23 lines
469 B
Go
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"`
|
|
DateFormat string `json:"date_format"`
|
|
}
|
|
|
|
func GetCfgHandler() http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
utils.WriteJSON(w, http.StatusOK, ServerConfig{
|
|
DefaultTheme: cfg.DefaultTheme(),
|
|
DateFormat: cfg.DateFormat(),
|
|
})
|
|
}
|
|
}
|
|
|