Documentation
¶
Overview ¶
Package server wires foundry's HTTP layer together and exposes the App that feature modules (crm, analytics, …) register themselves onto. server does NOT import the modules — main does the wiring — so there is no import cycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
Cfg *config.Config
Store *store.Store
Mux *http.ServeMux
// contains filtered or unexported fields
}
App is the shared context handed to every module's Register function.
func New ¶
New builds the App, loads templates, and mounts the base routes (static assets, auth, health, and the home dashboard). Modules are registered by the caller afterwards.
func (*App) Partial ¶
func (a *App) Partial(w http.ResponseWriter, name string, data any)
Partial writes a single htmx fragment by its {{define}} name.
func (*App) RequireAuth ¶
func (a *App) RequireAuth(next http.HandlerFunc) http.HandlerFunc
RequireAuth wraps a handler so only an authenticated admin can reach it.
Click to show internal directories.
Click to hide internal directories.