https://github.com/budgetdraw/sveltekit-cloudflare-adapter
Alternative SvelteKit adaptor for Cloudflare workers. Designed to be standalone and not use wrangler.
https://github.com/budgetdraw/sveltekit-cloudflare-adapter
Last synced: 7 months ago
JSON representation
Alternative SvelteKit adaptor for Cloudflare workers. Designed to be standalone and not use wrangler.
- Host: GitHub
- URL: https://github.com/budgetdraw/sveltekit-cloudflare-adapter
- Owner: budgetdraw
- License: mit
- Archived: true
- Created: 2021-10-24T21:14:25.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-17T23:24:29.000Z (almost 4 years ago)
- Last Synced: 2024-11-07T00:39:00.991Z (about 1 year ago)
- Language: JavaScript
- Size: 188 KB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-svelte-kit - Cloudflare
README
# @budgetdraw/sveltekit-cloudflare-adapter
Alternative SvelteKit adaptor for Cloudflare workers. Designed to be standalone
and not use wrangler.
## Installation
```shell
npm install --save-dev @budgetdraw/sveltekit-cloudflare-adapter
```
## Usage
Add the adapter to your `svelte.config.js`:
```js
import adapter from '@budgetdraw/sveltekit-cloudflare-adapter'
export default {
kit: {
target: '#svelte',
adapter: adapter()
}
}
```
## Non-standard Addition
In addition to the normal SvelteKit API, the request object has an additional
`cfFetchEvent` property containing the
[Cloudflare Worker FetchEvent](https://developers.cloudflare.com/workers/runtime-apis/fetch-event).
This is primarily to allow for [waitUntil method](https://developers.cloudflare.com/workers/runtime-apis/fetch-event#waituntil)
in order to perform an action after the response has been sent to the user - for
example in order to pass to [toucan-js](https://github.com/robertcepa/toucan-js).