MCPcopy Create free account
hub / github.com/PostHog/duckgres / serveStatic

Function serveStatic

controlplane/admin/devserver/main.go:243–249  ·  view source on GitHub ↗

serveStatic serves the dashboard's static assets. Any unrecognized path falls back to the models explorer (single-page-style entry).

(w http.ResponseWriter, r *http.Request, dir string)

Source from the content-addressed store, hash-verified

241 "models": "models.html",
242 "login": "login.html",
243 "models.html": "models.html",
244 "login.html": "login.html",
245}
246
247// serveStatic serves the dashboard's static assets. Any unrecognized path falls
248// back to the models explorer (single-page-style entry).
249func serveStatic(w http.ResponseWriter, r *http.Request, dir string) {
250 file, ok := dashboardPages[strings.TrimPrefix(r.URL.Path, "/")]
251 if !ok {
252 file = "models.html"

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected