Skip to content

chimame/remix-prisma-d1-on-cloudflare-pages

Repository files navigation

Remix + Prisma + D1

This is a sample program that uses Remix and D1 with Prisma that supports Edge Function.

Notes

As shown in this repository, if you build Remix and D1 for one worker, the file size will exceed 1MB. Please note that if this happens, you will not be able to deploy with a free Cloudflare account.

If you want to deploy with a free account, you can avoid this by building Remix and Prisma into separate Cloudflare Workers and using Service Bindings. Cloudflare now supports connecting Service Bindings with RPC, so it's not bad to use.

A sample using Service Bindings can be found here.

https://github.com/chimame/connect-remix-and-prisma-d1-using-rpc-on-cloudflare-pages

Typegen

Generate types for your Cloudflare bindings in wrangler.toml:

npm run typegen

You will need to rerun typegen whenever you make changes to wrangler.toml.

Development

Run the Vite dev server:

npm run dev

To run Wrangler:

npm run build
npm run start

Deployment

Warning

Cloudflare does not use wrangler.toml to configure deployment bindings. You MUST configure deployment bindings manually in the Cloudflare dashboard.

First, build your app for production:

npm run build

Then, deploy your app to Cloudflare Pages:

npm run deploy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published