BREAKING: make render fn an option on start (#260)
This commit removes the `_render.{tj}s{x}?` file in favor of a `render` option on the `start` call in `main.ts`.
This commit is contained in:
+5
-5
@@ -6,24 +6,24 @@ import {
|
||||
IslandModule,
|
||||
MiddlewareModule,
|
||||
PageModule,
|
||||
RendererModule,
|
||||
StartOptions,
|
||||
UnknownPageModule,
|
||||
} from "./types.ts";
|
||||
export type {
|
||||
FreshOptions,
|
||||
Handler,
|
||||
HandlerContext,
|
||||
Handlers,
|
||||
MiddlewareHandlerContext,
|
||||
RenderFunction,
|
||||
} from "./types.ts";
|
||||
export { RenderContext } from "./render.tsx";
|
||||
export type { RenderFn } from "./render.tsx";
|
||||
export type { InnerRenderFunction } from "./render.tsx";
|
||||
|
||||
export interface Manifest {
|
||||
routes: Record<
|
||||
string,
|
||||
| PageModule
|
||||
| RendererModule
|
||||
| MiddlewareModule
|
||||
| AppModule
|
||||
| ErrorPageModule
|
||||
@@ -37,9 +37,9 @@ export { ServerContext };
|
||||
|
||||
export async function start(
|
||||
routes: Manifest,
|
||||
opts?: StartOptions,
|
||||
opts: StartOptions = {},
|
||||
) {
|
||||
const ctx = await ServerContext.fromManifest(routes);
|
||||
const ctx = await ServerContext.fromManifest(routes, opts);
|
||||
console.log(
|
||||
`Server listening on http://${opts?.hostname ?? "localhost"}:${
|
||||
opts?.port ?? 8000
|
||||
|
||||
Reference in New Issue
Block a user