Cloudflare Pages
此内容尚不支持你的语言。
Product Factory’s frontend apps (web, admin, platform, docs) are deployed to Cloudflare Pages.
Build Configuration
Each app builds with Astro’s Cloudflare adapter:
| App | Build Command | Output |
|---|---|---|
web | pnpm --filter web build | apps/web/dist/ |
admin | pnpm --filter admin build | apps/admin/dist/ |
platform | pnpm --filter platform build | apps/platform/dist/ |
docs | pnpm --filter docs build | apps/docs/dist/ |
Cloudflare Pages Setup
- Create a new Pages project in the Cloudflare dashboard.
- Connect your Git repository.
- Configure build settings:
- Build command:
pnpm --filter <app-name> build - Build output directory:
apps/<app-name>/dist - Root directory:
/(monorepo root)
- Build command:
- Set environment variables (see Environment Variables).
Custom Domains
Each app should have its own subdomain:
| App | Domain |
|---|---|
web | example.com |
admin | admin.example.com |
platform | app.example.com |
docs | docs.example.com |
Configure custom domains in the Cloudflare Pages project settings.
Preview Deployments
Cloudflare Pages automatically creates preview deployments for pull requests. Each PR gets a unique URL for testing before merging.
Server-Side Rendering
The web, admin, and platform apps use Astro’s server output mode with the @astrojs/cloudflare adapter. This enables server-side rendering on Cloudflare Pages Functions.
The docs app uses Starlight’s default static output and does not require server-side rendering.