Skip to content

Commit

Permalink
[docs] update cloudflare adapter readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Nov 17, 2021
1 parent be0bf3b commit 325c2cd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
13 changes: 13 additions & 0 deletions packages/adapter-cloudflare-workers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ SvelteKit adapter that creates a Cloudflare Workers site using a function for dy

This is very experimental; the adapter API isn't at all fleshed out, and things will definitely change.

_**Comparisons**_

- `adapter-cloudflare` – supports all SvelteKit features; builds for
[Cloudflare Pages](https://blog.cloudflare.com/cloudflare-pages-goes-full-stack/)
- `adapter-cloudflare-workers` – supports all SvelteKit features; builds for
Cloudflare Workers
- `adapter-static` – only produces client-side static assets; compatible with
Cloudflare Pages

> **Note:** Cloudflare Pages' new Workers integration is currently in beta.<br/>
> Compared to `adapter-cloudflare-workers`, this adapter will be the preferred approach for most users since building on top of Pages unlocks automatic builds and deploys, preview deployments, instant rollbacks, etc.<br/>
> From SvelteKit's perspective, there is no difference and no functionality loss when migrating to/from the Workers and the Pages adapters.
## Usage

Install with `npm i -D @sveltejs/adapter-cloudflare-workers@next`, then add the adapter to your `svelte.config.js`:
Expand Down
4 changes: 4 additions & 0 deletions packages/adapter-cloudflare/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ _**Comparisons**_
- `adapter-static` – only produces client-side static assets; compatible with
Cloudflare Pages

> **Note:** Cloudflare Pages' new Workers integration is currently in beta.<br/>
> Compared to `adapter-cloudflare-workers`, this adapter will be the preferred approach for most users since building on top of Pages unlocks automatic builds and deploys, preview deployments, instant rollbacks, etc.<br/>
> From SvelteKit's perspective, there is no difference and no functionality loss when migrating to/from the Workers and the Pages adapters.
## Installation

```sh
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-cloudflare/files/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default {
});
}
} catch (e) {
return new Response('Error rendering route:' + (e.message || e.toString()), { status: 500 });
return new Response('Error rendering route: ' + (e.message || e.toString()), { status: 500 });
}

return new Response({
Expand Down

0 comments on commit 325c2cd

Please sign in to comment.