Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 1.33 KB

File metadata and controls

30 lines (23 loc) · 1.33 KB
title createHandler

The 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):

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

Argument Type Default Description
fn fn: (context: PageEvent) A function that returns the static document for your application.
options.mode string "stream" The SSR mode. Options are 'sync', 'async' and 'stream'.