{
  "id": "f57f946011b9b0354c6543d5",
  "source": "solid:signals",
  "type": "github-document",
  "title": "create-handler",
  "content": "---\ntitle: createHandler\nuse_cases: \u003e-\n  ssr mode configuration, server startup, streaming setup, async rendering,\n  performance tuning\ntags:\n  - handler\n  - ssr\n  - server\n  - streaming\n  - async\n  - rendering\nversion: '1.0'\ndescription: \u003e-\n  Configure server-side rendering modes in SolidStart. Choose between sync,\n  async, or streaming SSR for optimal performance and UX.\n---\n\nThe `createHandler` is used to start the server in [`entry-server.tsx`](/solid-start/reference/entrypoints/entry-server).\nIt takes a function that returns a static document (often created with [`\u003cStartServer\u003e`](/solid-start/reference/server/start-server)), and serves it using one of the three function for server side rendering (SSR):\n\n- [`renderToString`](/reference/rendering/render-to-string) - \"sync\"\n- [`renderToStringAsync`](/reference/rendering/render-to-string-async) - \"async\"\n- [`renderToStream`](/reference/rendering/render-to-stream) - \"stream\"\n\nThe SSR mode can be configured through the `mode` property on the options object:\n\n```tsx\nimport { createHandler, StartServer } from \"@solidjs/start/server\";\n\nexport default createHandler(() =\u003e (\n  \u003cStartServer document={...}\n  /\u003e\n), {\n  mode: \"async\"\n});\n```\n\n## Parameters\n\n| Argument     | Type                     | Default  | Description                                                       |\n| ------------ | ------------------------ | -------- | ----------------------------------------------------------------- |\n| fn           | fn: (context: PageEvent) |          | A function that returns the static document for your application. |\n| options.mode | string                   | \"stream\" | The SSR mode. Options are 'sync', 'async' and 'stream'.           |",
  "url": "https://github.com/solidjs/solid-docs/blob/HEAD/src/routes/solid-start/reference/server/create-handler.mdx",
  "metadata": {
    "path": "src/routes/solid-start/reference/server/create-handler.mdx",
    "repo": "solidjs/solid-docs",
    "repo_url": "https://github.com/solidjs/solid-docs.git",
    "size": 1708,
    "source_type": "github"
  },
  "hash": "192bebbb484676fdade65ade677a22ec58193c309a0391944d2ecf92e2563f71",
  "timestamp": "2026-02-23T11:43:00.195108103+01:00"
}