You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/workers/static-assets/migration-guides/migrate-from-pages.mdx
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ description: A guide for migrating from Cloudflare Pages to Cloudflare Workers.
8
8
---
9
9
10
10
import {
11
+
Aside,
11
12
Badge,
12
13
Description,
13
14
FileTree,
@@ -26,7 +27,7 @@ Like Pages, requests for static assets on Workers are free, and Pages Functions
26
27
27
28
Unlike Pages, Workers has a distinctly broader set of features available to it, (including Durable Objects, Cron Triggers, and more comprehensive Observability). A complete list can be found at [the bottom of this page](#compatibility-matrix). Workers will receive the focus of Cloudflare's development efforts going forwards, so we therefore [are recommending using Cloudflare Workers over Cloudflare Pages for any new projects](http://blog.cloudflare.com/full-stack-development-on-cloudflare-workers).
28
29
29
-
## Migration
30
+
## Migration
30
31
31
32
Migrating from Cloudflare Pages to Cloudflare Workers is often a straightforward process. The following are some of the most common steps you will need to take to migrate your project.
32
33
@@ -298,6 +299,15 @@ If you are [using Workers Builds](#builds), ensure you also [configure any varia
298
299
299
300
Where previously you used [`wrangler pages dev`](/workers/wrangler/commands/#dev-1) and [`wrangler pages deploy`](/workers/wrangler/commands/#deploy-1), now instead use [`wrangler dev`](/workers/wrangler/commands/#dev) and [`wrangler deploy`](/workers/wrangler/commands/#deploy). Additionally, if you are using a Vite-powered framework, [our new Vite plugin](/workers/vite-plugin/) may be able offer you an even simpler development experience.
300
301
302
+
<Aside
303
+
type="note"
304
+
title="Wrangler uses a different default port for local development"
305
+
>
306
+
`wrangler pages dev` will, by default, expose the local development server at
307
+
`http://localhost:8788`, whereas `wrangler dev` will expose it at
308
+
`http://localhost:8787/`. You can customize the port using `--port`.
309
+
</Aside>
310
+
301
311
### Builds
302
312
303
313
If you are using Pages' built-in CI/CD system, you can swap this for Workers Builds by first [connecting your repository to Workers Builds](/workers/ci-cd/builds/#get-started) and then [disabling automatic deployments on your Pages project](/pages/configuration/git-integration/#disable-automatic-deployments).
@@ -375,7 +385,7 @@ Once you have validated the behavior of Worker, and are satisfied with the devel
375
385
376
386
## Migrate your project using an AI coding assistant
377
387
378
-
You can add the following [experimental prompt](https://developers.cloudflare.com/workers/prompts/pages-to-workers.txt) in your preferred coding assistant (e.g. Claude Code, Cursor) to make your project compatible with Workers:
388
+
You can add the following [experimental prompt](https://developers.cloudflare.com/workers/prompts/pages-to-workers.txt) in your preferred coding assistant (e.g. Claude Code, Cursor) to make your project compatible with Workers:
0 commit comments