世祺 3f249ec233 添加README文档 | 1 ano atrás | |
---|---|---|
.idea | 1 ano atrás | |
node_modules | 1 ano atrás | |
src | 1 ano atrás | |
.dev.vars | 1 ano atrás | |
.editorconfig | 1 ano atrás | |
.gitignore | 1 ano atrás | |
.prettierrc | 1 ano atrás | |
README.md | 1 ano atrás | |
package.json | 1 ano atrás | |
wrangler.toml | 1 ano atrás | |
yarn.lock | 1 ano atrás |
[toc]
image-processing
node >=16.20.0
wrangler >=3.5.0
text-to-image
rust
wrangler
可从此处下载nvm[GitHub - coreybutler/nvm-windows: A node.js version management utility for Windows. Ironically written in Go.]
nvm use 21
npm install wrangler -g
参见此教程入门 - Rust 程序设计语言 (rust-lang.org)
ImageProcessing
npm install
text-to-image
此项目在部署时会自动安装所需依赖
修改wrangler.toml
文件内的[vars]
节,以修改环境变量。以下列出了常用的配置项。
属性 | 默认值 | 作用 |
---|---|---|
aws_base_url | 'plat-sg-cloudflare-testing.s3.ap-southeast-1.amazonaws.com' | 未使用预签名URL时,图片回源的AWS地址 |
self_host | 'cf-test.hoyoverse.com' | 自身部署的Host |
text_to_image_url | 'https://text-to-image.hoyoverse.workers.dev/' | 提供文字转图片的Workers URL,仅用于添加水印 |
执行以下命令进行部署
npm run deploy
在弹出的网页中进行登陆(可能需要关闭VPN)
在CLI中选择要部署的账户
等待上传完成
更新密钥
wrangler secret put accessKeyId
wrangler secret put secretAccessKey