MCPcopy Create free account
hub / github.com/driangle/taskmd / mountFallback

Method mountFallback

apps/cli/internal/web/server.go:224–238  ·  view source on GitHub ↗
(mux *http.ServeMux)

Source from the content-addressed store, hash-verified

222}
223
224func (s *Server) mountFallback(mux *http.ServeMux) {
225 mux.HandleFunc("/{path...}", func(w http.ResponseWriter, r *http.Request) {
226 if len(r.URL.Path) >= 4 && r.URL.Path[:4] == "/api" {
227 http.NotFound(w, r)
228 return
229 }
230 w.Header().Set("Content-Type", "text/html; charset=utf-8")
231 fmt.Fprint(w, `<!DOCTYPE html>
232<html><body style="font-family:system-ui;max-width:480px;margin:80px auto;text-align:center">
233<h2>taskmd</h2>
234<p>No web UI embedded in this build.</p>
235<p>Rebuild with <code>make build-full</code> or use <code>--dev</code> mode with the Vite dev server.</p>
236</body></html>`)
237 })
238}
239
240func corsMiddleware(next http.Handler) http.Handler {
241 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers 4

mountStaticMethod · 0.95

Calls

no outgoing calls

Tested by 3