feat: add readme

This commit is contained in:
dreamhunter2333
2023-08-21 19:11:38 +08:00
parent c4cf9469b0
commit 292571c9ac
5 changed files with 12 additions and 2 deletions
+12 -2
View File
@@ -6,14 +6,18 @@ This is a temporary email service that uses Cloudflare Workers to create a tempo
## Deploy ## Deploy
[Install/Update Wrangler](https://developers.cloudflare.com/workers/wrangler/install-and-update/)
## DB - Cloudflare D1 ## DB - Cloudflare D1
```bash ```bash
# create a database, and copy the config to wrangler.toml in the next step # create a database, and copy the output to wrangler.toml in the next step
wrangler d1 create dev wrangler d1 create dev
wrangler d1 execute dev --file=db/schema.sql wrangler d1 execute dev --file=db/schema.sql
``` ```
![d1](readme_assets/d1.png)
### Backend - Cloudflare workers ### Backend - Cloudflare workers
```bash ```bash
@@ -25,14 +29,20 @@ cp worker/wrangler.toml.template worker/wrangler.toml
wrangler deploy wrangler deploy
``` ```
you can find and test the api url in the workers dashboard
![worker](readme_assets/worker.png)
### Frontend - Cloudflare pages ### Frontend - Cloudflare pages
```bash ```bash
cd frontend cd frontend
pnpm install pnpm install
# add .env.local and modify it # add .env.local and modify VITE_API_BASE to your api url
cp .env.example .env.local cp .env.example .env.local
pnpm build --emptyOutDir pnpm build --emptyOutDir
cd .. cd ..
wrangler pages deploy dist --branch production wrangler pages deploy dist --branch production
``` ```
![pages](readme_assets/pages.png)
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB