MCPcopy
hub / github.com/wavetermdev/waveterm / registerHandlers

Method registerHandlers

tsunami/engine/serverhandlers.go:79–99  ·  view source on GitHub ↗
(mux *http.ServeMux, opts handlerOpts)

Source from the content-addressed store, hash-verified

77}
78
79func (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
101func (h *httpHandlers) handleRender(w http.ResponseWriter, r *http.Request) {
102 defer func() {

Callers 1

listenAndServeMethod · 0.80

Calls 3

handleManifestMethod · 0.95
handleStaticPathFilesMethod · 0.95
handleStaticFilesMethod · 0.95

Tested by

no test coverage detected