interface IApplication
Since 0.1.0

The application: registers plugins, owns the router and middleware pipeline, and manages the server lifecycle.

Properties

The application router.

The global middleware pipeline.

The application-scoped service registry.

Methods

Registers a plugin. Plugins register when the application starts, in dependency order.

start(options?: StartOptions): Promise<void>

Resolves plugins, builds the pipeline and router, and starts the server.

stop(): Promise<void>

Stops the server and runs shutdown hooks.

fetch(request: Request): Promise<Response>

Delegates a web-standard Request to the registered IHttpAdapter.fetch. This works regardless of whether start() was called (Cloudflare Workers path: setHandler runs at start() time, fetch works without listen).

Usage

import { type IApplication } from "common/src/index.ts";