Added API Endpoint and Admin Dashboard Endpoint

This commit is contained in:
2026-05-26 15:52:59 +02:00
parent 48f62500d5
commit 8ec5472355
7 changed files with 368 additions and 8 deletions
+27
View File
@@ -0,0 +1,27 @@
package api
import (
"encoding/json"
"net/http"
)
// NewHandler returns the API HTTP handler (routes under /).
func NewHandler() http.Handler {
mux := http.NewServeMux()
mux.HandleFunc("GET /health", health)
mux.HandleFunc("GET /", root)
return mux
}
func health(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
}
func root(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(map[string]string{
"service": "printer-backend-api",
"message": "API placeholder — endpoints folgen",
})
}