(mux *http.ServeMux, opts handlerOpts)
| 77 | } |
| 78 | |
| 79 | func (h *httpHandlers) registerHandlers(mux *http.ServeMux, opts handlerOpts) { |
| 80 | mux.HandleFunc("/api/render", h.handleRender) |
| 81 | mux.HandleFunc("/api/updates", h.handleSSE) |
| 82 | mux.HandleFunc("/api/data", h.handleData) |
| 83 | mux.HandleFunc("/api/config", h.handleConfig) |
| 84 | mux.HandleFunc("/api/schemas", h.handleSchemas) |
| 85 | mux.HandleFunc("/api/manifest", h.handleManifest(opts.ManifestFile)) |
| 86 | mux.HandleFunc("/api/modalresult", h.handleModalResult) |
| 87 | mux.HandleFunc("/api/terminput", h.handleTermInput) |
| 88 | mux.HandleFunc("/dyn/", h.handleDynContent) |
| 89 | |
| 90 | // Add handler for static files at /static/ path |
| 91 | if opts.StaticFS != nil { |
| 92 | mux.HandleFunc("/static/", h.handleStaticPathFiles(opts.StaticFS)) |
| 93 | } |
| 94 | |
| 95 | // Add fallback handler for embedded static files in production mode |
| 96 | if opts.AssetsFS != nil { |
| 97 | mux.HandleFunc("/", h.handleStaticFiles(opts.AssetsFS)) |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | func (h *httpHandlers) handleRender(w http.ResponseWriter, r *http.Request) { |
| 102 | defer func() { |
no test coverage detected