Cloudflare Pages Middleware

Qwik City Cloudflare Pages middleware allows you to connect Qwik City to Cloudflare Pages.

Below is an example of using the built-in middleware within a user's app.

// entry.server.tsx
import render from './entry.ssr';
import { qwikCity } from '@builder.io/qwik-city/middleware/cloudflare-pages';

export const onRequest = qwikCity(render);

The compiled middleware can then be used anywhere in the cloudflare pages /functions directory.

// export the compiled middleware where cloudflare pages can find it.
// for example use /functions/[[path]].ts or /functions/_middleware.ts
// to have qwik city handle all requests.

export { onRequest } from '../server/entry.server';
Made with โค๏ธ by