morz-infoboard/server/backend/internal/httpapi/router.go
Jesko Anschütz 3fd6ed7432 Lege ersten Player-Status-Endpunkt an
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-03-22 17:42:37 +01:00

34 lines
766 B
Go

package httpapi
import (
"net/http"
)
func NewRouter() http.Handler {
mux := http.NewServeMux()
mux.HandleFunc("GET /healthz", func(w http.ResponseWriter, r *http.Request) {
writeJSON(w, http.StatusOK, map[string]string{
"status": "ok",
"service": "morz-infoboard-backend",
})
})
mux.HandleFunc("GET /api/v1", func(w http.ResponseWriter, r *http.Request) {
writeJSON(w, http.StatusOK, map[string]any{
"name": "morz-infoboard-backend",
"version": "dev",
"tools": []string{
"message-wall-resolve",
},
})
})
mux.HandleFunc("GET /api/v1/meta", handleMeta)
mux.HandleFunc("POST /api/v1/player/status", handlePlayerStatus)
mux.HandleFunc("POST /api/v1/tools/message-wall/resolve", handleResolveMessageWall)
return mux
}