https://github.com/marcomafessolli/remix-prisma-cloudflare-workers
Run Remix with Prisma on Cloudflare Workers
https://github.com/marcomafessolli/remix-prisma-cloudflare-workers
cloudflare cloudflare-workers prisma remix
Last synced: 6 months ago
JSON representation
Run Remix with Prisma on Cloudflare Workers
- Host: GitHub
- URL: https://github.com/marcomafessolli/remix-prisma-cloudflare-workers
- Owner: marcomafessolli
- License: mit
- Created: 2021-12-31T22:01:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-30T23:26:27.000Z (over 2 years ago)
- Last Synced: 2024-08-03T13:05:07.945Z (9 months ago)
- Topics: cloudflare, cloudflare-workers, prisma, remix
- Language: TypeScript
- Homepage:
- Size: 1.3 MB
- Stars: 35
- Watchers: 1
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
x# Remix + Cloudflare Workers + Prisma!
- [Remix Docs](https://remix.run/docs)
## Live Demo
- [Demo](https://remix-cloudflare-workers.marcomafessolli.workers.dev)
## Setup
Before starting, make sure you have the following:
* `node >= 16`
* A Prisma Data Proxy account
* Followed [Deploying to Cloudflare Workers](https://www.prisma.io/docs/guides/deployment/deployment-guides/deploying-to-cloudflare-workers) documentation and did steps 2, 6 and 7
* A `.env` file with `DATABASE_URL` that points to your prisma data proxy accountFor more information, visit [this](https://www.prisma.io/docs/concepts/data-platform/data-proxy#edge-runtimes)
After that, run:
* `npm install`
Edge functions cannot access files in the file system which prevents Prisma to load values from `.env`, so it is necessary to set up a wrangler secret by using wrangler's CLI or the dashboard.
```sh
$ wrangler secret put DATABASE_URL
```And finally, generate a new Prisma Client by running:
* `npm run generate-client`
Check [Prisma and Cloudflare](https://www.prisma.io/docs/guides/deployment/deployment-guides/deploying-to-cloudflare-workers) for more information.
## Development
```sh
$ npm run dev
```And then check `http://127.0.0.1:8787`. You're ready 💇♂️
## Deployment
```sh
npm run deploy
```