MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / SetWebUI

Method SetWebUI

internal/server/server.go:2742–2747  ·  view source on GitHub ↗

SetWebUI sets the embedded web UI filesystem for serving the SPA.

(fsys fs.FS)

Source from the content-addressed store, hash-verified

2740
2741// SetWebUI sets the embedded web UI filesystem for serving the SPA.
2742func (s *Server) SetWebUI(fsys fs.FS) {
2743 s.webFS = fsys
2744 s.webIdentity = identifyWebBuild(fsys)
2745 s.ensureRouter()
2746 s.router.Handle("/*", s.spaHandler())
2747}
2748
2749func (s *Server) spaHandler() http.Handler {
2750 fileServer := http.FileServer(http.FS(s.webFS))

Calls 4

ensureRouterMethod · 0.95
spaHandlerMethod · 0.95
identifyWebBuildFunction · 0.85
HandleMethod · 0.45