@budgetdraw/sveltekit-cloudflare-adapter

0.3.0 • Public • Published

@budgetdraw/sveltekit-cloudflare-adapter

Alternative SvelteKit adaptor for Cloudflare workers. Designed to be standalone and not use wrangler.

Installation

npm install --save-dev @budgetdraw/sveltekit-cloudflare-adapter

Usage

Add the adapter to your svelte.config.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. This is primarily to allow for waitUntil method in order to perform an action after the response has been sent to the user - for example in order to pass to toucan-js.

Readme

Keywords

none

Package Sidebar

Install

npm i @budgetdraw/sveltekit-cloudflare-adapter

Weekly Downloads

6

Version

0.3.0

License

MIT

Unpacked Size

35.3 kB

Total Files

20

Last publish

Collaborators

  • budgetdrawdev