@danzlarkin/astro-cloudflare
v0.0.1
Published
Deploy your site to cloudflare workers or cloudflare pages
Downloads
5
Readme
@danzlarkin/astro-cloudflare
A modified fork of @astrojs/cloudflare
An SSR adapter for use with Cloudflare Pages Functions targets. Write your code in Astro/Javascript and deploy to Cloudflare Pages.
Install
Add the Cloudflare adapter to enable SSR in your Astro project with the following astro add
command. This will install the adapter and make the appropriate changes to your astro.config.mjs
file in one step.
# Using NPM
npx astro add cloudflare
# Using Yarn
yarn astro add cloudflare
# Using PNPM
pnpm astro add cloudflare
If you prefer to install the adapter manually instead, complete the following two steps:
- Add the Cloudflare adapter to your project's dependencies using your preferred package manager. If you’re using npm or aren’t sure, run this in the terminal:
npm install @danzlarkin/astro-cloudflare
- Add the following to your
astro.config.mjs
file:
// astro.config.mjs
import { defineConfig } from 'astro/config';
import cloudflare from '@danzlarkin/astro-cloudflare';
export default defineConfig({
output: 'server',
adapter: cloudflare()
});