feat: update readme

This commit is contained in:
dreamhunter2333
2023-08-24 17:21:59 +08:00
parent e4ed258beb
commit 65e677a774
4 changed files with 22 additions and 5 deletions

View File

@@ -1,9 +1,20 @@
# cloudflare_temp_email
# cloudflare temp email
利用 Cloudflare Workers 创建临时邮箱
- 使用 Cloudflare Pages 部署前端
- 使用 Cloudflare Workers 部署后端
- email 转发使用 Cloudflare Email Route
- Cloudflare D1 作为数据库。
[在线演示](https://temp-email.dreamhunter2333.xyz/)
This is a temporary email service that uses Cloudflare Workers to create a temporary email address and view the received email in web browser.
[Live Demo](https://temp-email.dreamhunter2333.xyz/)
![demo](readme_assets/demo.png)
## Deploy
[Install/Update Wrangler](https://developers.cloudflare.com/workers/wrangler/install-and-update/)
@@ -23,17 +34,22 @@ wrangler d1 execute dev --file=db/schema.sql
```bash
cd worker
npm install
# copy wrangler.toml.template to wrangler.toml and modify it
# copy wrangler.toml.template to wrangler.toml
# and add your d1 config and these config
# PREFIX = "tmp" - the email create will be like tmp<xxxxx>@DOMAIN
# DOMAIN = "xxx.xxx" - you domain name
# JWT_SECRET = "xxx"
# BLACK_LIST = ""
cp wrangler.toml.template wrangler.toml
# deploy
wrangler deploy
```
you can find and test the api url in the workers dashboard
you can find and test the worker's url in the workers dashboard
![worker](readme_assets/worker.png)
config email forward
enable email route and config email forward catch-all to the worker
![email](readme_assets/email.png)
@@ -42,7 +58,7 @@ config email forward
```bash
cd frontend
pnpm install
# add .env.local and modify VITE_API_BASE to your api url
# add .env.local and modify VITE_API_BASE to your worker's url
cp .env.example .env.local
pnpm build --emptyOutDir
cd ..

BIN
image.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

BIN
readme_assets/demo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 KiB

View File

@@ -7,6 +7,7 @@ node_compat = true
PREFIX = "tmp"
DOMAIN = "xxx.xxx"
JWT_SECRET = "xxx"
BLACK_LIST = ""
[[d1_databases]]
binding = "DB"