--------------------
D1 is currently in open alpha and is not recommended for production data and traffic
Please report any bugs to https://github.com/cloudflare/workers-sdk/issues/new/choose
To request features, visit https://community.cloudflare.com/c/developers/d1
To give feedback, visit https://discord.gg/cloudflaredev
--------------------
✅ Successfully created DB 'yemeng_email' in region WNAM
Created your database using D1's new storage backend. The new storage backend is not yet recommended for production
workloads, but backs up your data via point-in-time restore.
[[d1_databases]]
binding = "DB" # i.e. available in your Worker on env.DB
database_name = "yemeng_email"
database_id = "yemeng666999"
--------------------
D1 is currently in open alpha and is not recommended for production data and traffic
Please report any bugs to https://github.com/cloudflare/workers-sdk/issues/new/choose
To request features, visit https://community.cloudflare.com/c/developers/d1
To give feedback, visit https://discord.gg/cloudflaredev
--------------------
Mapping SQL input into an array of statements
Parsing 4 statements
Executing on yemeng_email (66666666):
Executed 4 commands in 0.6972070000047097ms
其中 vars 里面的domain可以是你在cf托管的任何一个域名。jmt_secret可以随便写。D1 database就是之前的数据库信息。保存好这些数据,之后我们会用到。
然后我们执行
cd ~ && cd cloudflare_temp_email && cd worker
npm install
# 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
cd ~ && cd cloudflare_temp_email && cd frontend
pnpm install
依赖安装完毕以后,我们复制环境变量配置文件。
# add .env.local and modify VITE_API_BASE to your api url
cp .env.example .env.local
这里我们要修改的是VITE_API_BASE,就是上一步设置的域名url。比如我这边的设置如下:
vim .env.local
You should add .env.local and modify VITE_API_BASE to your worker's url .
For example: VITE_API_BASE=https://xxx.xxx.workers.dev - don't put / in the end