Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PublicFS, _ = fs.Sub(embeddedFS, "embed/public")
PublicFS is the SPA filesystem rooted at embed/public/. Vite builds to dist/ and cmd/build-web copies it to embed/public/.
Functions ¶
func NewSPAHandler ¶
func NewSPAHandler(opts *SPAOptions) (http.Handler, error)
NewSPAHandler returns an HTTP handler that serves the embedded frontend with SPA fallback to index.html for unknown paths.
Types ¶
type SPAOptions ¶
type SPAOptions struct {
// APIPrefix is the URL prefix for API routes that should NOT be served by the SPA.
APIPrefix string
// ArtifactPrefix is the URL prefix for artifact file serving.
ArtifactPrefix string
}
SPAOptions configures the SPA handler behaviour.
Click to show internal directories.
Click to hide internal directories.