Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RuntimeConfig ¶ added in v0.1.2
type RuntimeConfig struct {
AuthProviderURL string `json:"authProviderURL"`
}
RuntimeConfig is injected into the served index.html as a nested global `window.ethpandaops.assertoor.config` so the SPA can read it synchronously at boot — no extra round-trip to the backend.
type SPAHandler ¶
type SPAHandler struct {
// contains filtered or unexported fields
}
SPAHandler serves a React single-page application. It serves static files when they exist, otherwise falls back to index.html for client-side routing.
func NewSPAHandler ¶
func NewSPAHandler(logger logrus.FieldLogger, runtimeConfig RuntimeConfig) (*SPAHandler, error)
NewSPAHandler creates a new SPA handler. The runtimeConfig is encoded into a small <script> block injected into the <head> of index.html before any other script runs.
func (*SPAHandler) ServeHTTP ¶
func (h *SPAHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.Handler.
Click to show internal directories.
Click to hide internal directories.