https://github.com/prisma/deployment-example-cloudflare-workers
Cloudflare workers deployment example
https://github.com/prisma/deployment-example-cloudflare-workers
Last synced: 2 months ago
JSON representation
Cloudflare workers deployment example
- Host: GitHub
- URL: https://github.com/prisma/deployment-example-cloudflare-workers
- Owner: prisma
- Created: 2023-06-09T09:06:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-24T17:06:58.000Z (almost 3 years ago)
- Last Synced: 2026-04-14T20:37:36.755Z (3 months ago)
- Language: TypeScript
- Size: 24.4 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cloudflare Workers Deployment Example
## Getting started
Clone the example:
```bash
git clone git@github.com:prisma/deployment-example-cloudflare-workers
```
Install the dependencies:
```bash
cd deployment-example-cloudflare-workers
npm install
```
Create a `.env` file:
```bash
cp .env.sample .env
```
Update the `DIRECT_DATABASE_URL` environment variable to point ot your database:
```bash
DIRECT_DATABASE_URL="postgresql://johndoe:super-strong-password@host.db.ondigitalocean.com:5432/deployment-example-cloudflare-workers"
```
Configure your database connection string and an [Accelerate connection string](https://prisma.io/accelerate?q=TODO):
```bash
# .env
DATABASE_URL="prisma://accelerate.prisma-data.net/?api_key=API_KEY"
```
Update your `wrangler.toml` file with your Accelerate connection string
```toml
# wrangler.toml
[vars]
DATABASE_URL="prisma://accelerate.prisma-data.net/?api_key=API_KEY"
```
Start up the application
```
npm run dev
```
Open up [http://127.0.0.0:8787](http://127.0.0.0:8787) in your browser to make sure it's working
Deploy the application:
```
npm run deploy
```