Documentation
¶
Index ¶
- func CORSMiddleware(allowedOrigins []string, next http.Handler) http.Handler
- func ReadJSON(r *http.Request, dst any) error
- func SPAHandler(distDir, mountPrefix string) http.Handler
- func WriteError(w http.ResponseWriter, status int, msg string)
- func WriteJSON(w http.ResponseWriter, status int, v any)
- type WSConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORSMiddleware ¶
CORSMiddleware permits cross-origin requests with credentials for local/UI deployments.
func SPAHandler ¶
SPAHandler serves a built Vite/React SPA directory (distDir) under mountPrefix (e.g. "/ui"), serving static files directly and falling back to index.html for client-side routes.
func WriteError ¶
func WriteError(w http.ResponseWriter, status int, msg string)
WriteError encodes a FastAPI-compatible `{"detail": msg}` JSON error response.