ServerHandlers
Select which server proxies are attached to a browser route.
Compatibility
ReactAvailable in this renderer's browser integration.
React SSRClient-side setup for an SSR application; do not execute on the server.
PreactAvailable in this renderer's browser integration.
Preact SSRClient-side setup for an SSR application; do not execute on the server.
Import from @kasperrt/smolter/react/client @kasperrt/smolter/preact/client
Signature
interface ServerHandlers {
loader?: boolean;
action?: boolean;
/** Legacy application-scoped endpoint. Omit to use the route .__smolter suffix. */
dataEndpoint?: string;
}Usage
Select which server proxies are attached to a browser route. Both loader and action default to enabled when the whole argument is omitted. When provided, only truthy fields are enabled.
serverRoute("/tasks", browserModule, { loader: true });Application data endpoint
Data requests use the route pathname plus .__smolter by default, independently of the asset/CDN base. Explicit dataEndpoint retains the legacy ?url= transport and must agree across browser, Vite and production adapters. Reserve the suffix in host routing and apply authentication to document and data requests.
Fields
loader
loader?: boolean;action
action?: boolean;dataEndpoint
dataEndpoint?: string;Legacy application-scoped endpoint. Omit to use the route .__smolter suffix.