mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-11 09:59:46 +08:00
53 lines
1.1 KiB
Markdown
53 lines
1.1 KiB
Markdown
# cloudflare_temp_email
|
|
|
|
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/)
|
|
|
|
## Deploy
|
|
|
|
[Install/Update Wrangler](https://developers.cloudflare.com/workers/wrangler/install-and-update/)
|
|
|
|
## DB - Cloudflare D1
|
|
|
|
```bash
|
|
# create a database, and copy the output to wrangler.toml in the next step
|
|
wrangler d1 create dev
|
|
wrangler d1 execute dev --file=db/schema.sql
|
|
```
|
|
|
|

|
|
|
|
### Backend - Cloudflare workers
|
|
|
|
```bash
|
|
cd worker
|
|
npm install
|
|
# copy wrangler.toml.template to wrangler.toml and modify it
|
|
cp wrangler.toml.template wrangler.toml
|
|
# deploy
|
|
wrangler deploy
|
|
```
|
|
|
|
you can find and test the api url in the workers dashboard
|
|
|
|

|
|
|
|
config email forward
|
|
|
|

|
|
|
|
### Frontend - Cloudflare pages
|
|
|
|
```bash
|
|
cd frontend
|
|
pnpm install
|
|
# add .env.local and modify VITE_API_BASE to your api url
|
|
cp .env.example .env.local
|
|
pnpm build --emptyOutDir
|
|
cd ..
|
|
wrangler pages deploy dist --branch production
|
|
```
|
|
|
|

|