import { type AppRouterOptions } from "https://deno.land/x/udibo_react_app@0.17.0/server.tsx";
An interface that represents the options for creating an App Router.
Type Parameters
Properties
A react router route object.
The build script will automatically generate this for your application's routes.
The route object is a default export from _main.tsx
in your routes directory.
Default environment variables that you would like to share with the browser for all requests.
Creates a provider that wraps the entire application.
A context object for the App. State stored within the AppContext will be serialized and shared with the browser.
A function used to render the application to a readable stream.
If you'd like to transform the stream before it is returned to the client,
you can wrap the default renderToReadableStream
to pipe it through a transform stream.
For example, the following renderToReadableStream
function uses the default function
then pipe's it through a transform stream that adds a tailwindcss style sheet to the head of the HTML page using twind.
async renderToReadableStream(context: Context<AppState>) {
return (await renderToReadableStream(context))
.pipeThrough(new TwindStream(tw));
}
The Oak router for the application.
The router object will be generated automatically for the application's routes.
The object is the default export from the _main.ts
file in the routes directory.
The working directory of the application. Defaults to the current working directory that the application is running from.