---
title: \@qwik.dev/qwik-router/middleware/cloudflare-pages API Reference
---

# [API](/api) &rsaquo; @qwik.dev/qwik-router/middleware/cloudflare-pages

<h2 id="createqwikcity">createQwikCity</h2>

> Warning: This API is now obsolete.
>
> Use `createQwikRouter` instead. Will be removed in V3

```typescript
createQwikCity: typeof createQwikRouter;
```

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/middleware/cloudflare-pages/index.ts)

<h2 id="createqwikrouter">createQwikRouter</h2>

```typescript
export declare function createQwikRouter(
  opts: QwikRouterCloudflarePagesOptions,
): (
  request: PlatformCloudflarePages["request"],
  env: PlatformCloudflarePages["env"] & {
    ASSETS: {
      fetch: (req: Request) => Response;
    };
  },
  ctx: PlatformCloudflarePages["ctx"],
) => Promise<Response>;
```

<table><thead><tr><th>

Parameter

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

opts

</td><td>

[QwikRouterCloudflarePagesOptions](#qwikroutercloudflarepagesoptions)

</td><td>

</td></tr>
</tbody></table>

**Returns:**

(request: [PlatformCloudflarePages](#platformcloudflarepages)["request"], env: [PlatformCloudflarePages](#platformcloudflarepages)["env"] &amp; \{ ASSETS: \{ fetch: (req: Request) =&gt; Response; }; }, ctx: [PlatformCloudflarePages](#platformcloudflarepages)["ctx"]) =&gt; Promise&lt;Response&gt;

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/middleware/cloudflare-pages/index.ts)

<h2 id="platformcloudflarepages">PlatformCloudflarePages</h2>

```typescript
export interface PlatformCloudflarePages
```

<table><thead><tr><th>

Property

</th><th>

Modifiers

</th><th>

Type

</th><th>

Description

</th></tr></thead>
<tbody><tr><td>

ctx

</td><td>

</td><td>

\{ waitUntil: (promise: Promise&lt;any&gt;) =&gt; void; }

</td><td>

</td></tr>
<tr><td>

env?

</td><td>

</td><td>

Record&lt;string, any&gt;

</td><td>

_(Optional)_

</td></tr>
<tr><td>

request

</td><td>

</td><td>

Request

</td><td>

</td></tr>
</tbody></table>

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/middleware/cloudflare-pages/index.ts)

<h2 id="qwikcitycloudflarepagesoptions">QwikCityCloudflarePagesOptions</h2>

> Warning: This API is now obsolete.
>
> Use `QwikRouterCloudflarePagesOptions` instead. Will be removed in V3

```typescript
export type QwikCityCloudflarePagesOptions = QwikRouterCloudflarePagesOptions;
```

**References:** [QwikRouterCloudflarePagesOptions](#qwikroutercloudflarepagesoptions)

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/middleware/cloudflare-pages/index.ts)

<h2 id="qwikroutercloudflarepagesoptions">QwikRouterCloudflarePagesOptions</h2>

```typescript
export interface QwikRouterCloudflarePagesOptions extends ServerRenderOptions
```

**Extends:** ServerRenderOptions

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/middleware/cloudflare-pages/index.ts)
