Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fresh/src/server/mod.ts>ServerContext

The next-gen web framework.
Extremely Popular
Go to Latest
class ServerContext
Re-export
import { ServerContext } from "https://deno.land/x/fresh@1.5.1/src/server/mod.ts";

Constructors

new
ServerContext(
routes: Route[],
islands: Island[],
staticFiles: StaticFile[],
renderfn: RenderFunction,
middlewares: MiddlewareRoute[],
app: AppModule,
layouts: LayoutRoute[],
notFound: UnknownPage,
error: ErrorPage,
plugins: Plugin[],
configPath: string,
jsxConfig: JSXConfig,
dev: boolean,
routerOptions: RouterOptions,
target: string | string[],
snapshot?: BuildSnapshot | null,
)

Methods

handler(): (req: Request, connInfo?: ServeHandlerInfo) => Promise<Response>

This functions returns a request handler that handles all routes required by Fresh, including static files.

Static Methods

fromManifest(manifest: Manifest, config: FromManifestConfig): Promise<ServerContext>

Process the manifest into individual components and pages.