32 lines
698 B
Go
32 lines
698 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/tools/message-wall/resolve", handleResolveMessageWall)
|
|
|
|
return mux
|
|
}
|