package health import "net/http" // PlaygroundHandler serves a self-contained HTML playground page at GET /playground. // The page lets visitors type text, submit it to POST /playground/analyze, and see // the PII entities highlighted inline — no login required. func PlaygroundHandler(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html; charset=utf-8") // CSP relaxed for playground: allow inline scripts/styles + fetch to same origin. w.Header().Set("Content-Security-Policy", "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; connect-src 'self'") w.WriteHeader(http.StatusOK) _, _ = w.Write([]byte(playgroundHTML)) } const playgroundHTML = `
Enter text to see automatic PII detection and pseudonymization. No account required.