Documentation
¶
Overview ¶
Package middlewares exposes the Gothic runtime as a single chi middleware, driven by the Runtime block declared in gothic.config.go. Applied like any chi middleware (router.Use), it keeps main.go tiny while new built-in route features light up automatically on a framework upgrade — the user never edits main.go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
Middleware returns a chi middleware — applied like router.Use(middleware.Logger) — that wires the whole Gothic runtime from a single RuntimeConfig: it initializes the cache backend once, then serves the framework's built-in paths (/public/* static assets and the /optimizedImage/* endpoint), letting every other request fall through to the routes you register on the router. New built-in route features are added here and appear automatically.
func SetEmbeddedPublicFS ¶ added in v1.2.0
SetEmbeddedPublicFS registers the embed.FS backing /public/* when the app's RuntimeConfig uses ServeStaticFiles == EMBEDDED. It forwards into the core router. The generated root embed file (which owns the //go:embed public directive) calls this from init(), before main(); user main.go imports this package, not core/router directly. fsys MUST already be rooted at the public dir (fs.Sub'd).
Types ¶
This section is empty.