createHandler - Solid Docs

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

ArgumentTypeDefaultDescription
fnfn: (context: PageEvent)A function that returns the static document for your application.
options.modestring"stream"The SSR mode. Options are 'sync', 'async' and 'stream'.