API › @qwik.dev/qwik-router/middleware/node
createQwikCity
Warning: This API is now obsolete.
Use
createQwikRouterinstead. Will be removed in V3
createQwikCity: typeof createQwikRouter;
createQwikRouter
export declare function createQwikRouter(
opts: QwikRouterNodeRequestOptions | QwikCityNodeRequestOptions,
): QwikRouterNodeMiddleware;
Parameter | Type | Description |
|---|---|---|
opts |
Returns:
NodeRequestNextFunction
export interface NodeRequestNextFunction
PlatformNode
export interface PlatformNode
Property | Modifiers | Type | Description |
|---|---|---|---|
incomingMessage? | IncomingMessage | Http2ServerRequest | (Optional) | |
node? | string | (Optional) | |
ssr? | true | (Optional) |
QwikCityNodeRequestOptions
Warning: This API is now obsolete.
Use
QwikRouterNodeRequestOptionsinstead. Will be removed in V3
export type QwikCityNodeRequestOptions = QwikRouterNodeRequestOptions;
References: QwikRouterNodeRequestOptions
QwikRouterNodeMiddleware
export interface QwikRouterNodeMiddleware
Property | Modifiers | Type | Description |
|---|---|---|---|
notFound | (req: IncomingMessage | Http2ServerRequest, res: ServerResponse, next: (e: any) => void) => Promise<void> | ||
router | (req: IncomingMessage | Http2ServerRequest, res: ServerResponse, next: NodeRequestNextFunction) => Promise<void> | ||
staticFile | (req: IncomingMessage | Http2ServerRequest, res: ServerResponse, next: (e?: any) => void) => Promise<void> |
QwikRouterNodeRequestOptions
export interface QwikRouterNodeRequestOptions extends ServerRenderOptions
Extends: ServerRenderOptions
Property | Modifiers | Type | Description |
|---|---|---|---|
getClientConn? | (req: IncomingMessage | Http2ServerRequest) => ClientConn | (Optional) Provide a function that returns a | |
getOrigin? | (req: IncomingMessage | Http2ServerRequest) => string | null | (Optional) Provide a function that computes the origin of the server, used to resolve relative URLs and validate the request origin against CSRF attacks. When not specified, it defaults to the If | |
origin? | string | (Optional) | |
static? | { root?: string; cacheControl?: string; } | (Optional) Options for serving static files |