createHandler
Edit this pageThe createHandler
is used to start the server in entry-server.tsx
.
It takes a function that returns a static document (often created with <StartServer>
), and serves it using one of the three function for server side rendering (SSR):
renderToString
- "sync"renderToStringAsync
- "async"renderToStream
- "stream"
The SSR mode can be configured through the mode
property on the options object:
import { createHandler, StartServer } from "@solidjs/start/server";
export default createHandler(() => ( <StartServer document={...} />), { mode: "async"});
Parameters
fn
Type: fn: (context: PageEvent)
A function that returns the static document for your application.
options.mode
Type: "sync" | "async" | "stream"
Default: "stream"
The SSR mode.