import { ServerContext } from "./context.ts";export type { FromManifestConfig, FromManifestOptions } from "./context.ts";export { STATUS_CODE } from "./deps.ts";import { ErrorHandler, FreshConfig, Handler, Handlers, IslandModule, LayoutConfig, MiddlewareModule, RouteConfig, ServeHandlerInfo, UnknownHandler,} from "./types.ts";import { startServer } from "./boot.ts";export { defineApp, defineConfig, defineLayout, defineRoute,} from "./defines.ts";export type { AppContext, AppProps, DenoConfig, ErrorHandler, ErrorHandlerContext, ErrorPageProps, FreshConfig, FreshContext, FreshOptions, Handler, HandlerContext, Handlers, LayoutConfig, LayoutContext, LayoutProps, MiddlewareHandler, MiddlewareHandlerContext, MultiHandler, PageProps, Plugin, PluginAsyncRenderContext, PluginAsyncRenderFunction, PluginIslands, PluginMiddleware, PluginRenderContext, PluginRenderFunction, PluginRenderFunctionResult, PluginRenderResult, PluginRenderScripts, PluginRenderStyleTag, PluginRoute, RenderFunction, ResolvedFreshConfig, RouteConfig, RouteContext, RouterOptions, ServeHandlerInfo, StartOptions, UnknownHandler, UnknownHandlerContext, UnknownPageProps,} from "./types.ts";export { RenderContext } from "./render.ts";export type { InnerRenderFunction } from "./render.ts";export type { DestinationKind } from "./router.ts";
export interface Manifest { routes: Record< string, { default?: ( propsOrRequest: any, ctx: any, ) => Promise<any | Response> | any; handler?: | Handler<any, any> | Handlers<any, any> | UnknownHandler | ErrorHandler; config?: RouteConfig | LayoutConfig; } | MiddlewareModule >; islands: Record<string, IslandModule>; baseUrl: string;}
export { ServerContext };
export async function createHandler( manifest: Manifest, config: FreshConfig = {},): Promise< (req: Request, connInfo?: ServeHandlerInfo) => Promise<Response>> { const ctx = await ServerContext.fromManifest(manifest, config); return ctx.handler();}
export async function start(manifest: Manifest, config: FreshConfig = {}) { const ctx = await ServerContext.fromManifest(manifest, { ...config, dev: false, }); const realConfig = config.server ?? config; await startServer(ctx.handler(), { ...realConfig, basePath: config?.router?.basePath ?? "", });}