httpserver.NewApp(...) is the default runtime entrypoint. It mounts the
generated App Bundle, applies i18n middleware when configured, serves static
assets and public files by convention, exposes the health endpoint, and routes
discovery endpoints.
framework/httpserver
The normal server setup is:
handler, err := httpserver.NewApp(httpserver.Config[*runtime.Context]{
App: generated.Bundle(appContext),
})
if err != nil {
return err
}Convention defaults:
- static manifest:
web/assets-build/manifest.json - static prefix:
/_assets/ - public files:
web/public - health endpoint:
/healthz
Use Custom Config only when you need app-owned hooks around the default
runtime:
handler, err := httpserver.NewApp(httpserver.Config[*runtime.Context]{
App: generated.Bundle(appContext),
Custom: httpserver.CustomConfig{
MainMiddlewares: []func(http.Handler) http.Handler{
requestIDMiddleware,
},
},
})
if err != nil {
return err
}Custom Config is the right place for middleware, cache-policy overrides,
public-file overrides, or extra routes. It is not where you replace the
generated App Bundle.
Stay on the default path if convention behavior is enough.
Use Custom Config for middleware, cache headers, extra routes, or static/public
overrides.
Use Advanced composition only when you need app-owned runtime packages that do
not fit the default wiring surface.