Replies: 1 comment 2 replies
-
代码有问题,不能部署到cloudflare中 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
StatusLive项目中,由于 UptimeRobot API 对请求速率存在限制,所以在访问量比较大的时后端需要一定的缓存。大多数云函数平台并没有提供类似 Redis 的键值读取功能,也不支持在本身函数范围内读写数据,但 Cloudflare Workers 除外。
Cloudflare Workers 相比其他的云函数平台,更适合 StatusLive 作为反代,原因如下:
之前已有小伙伴提出此需求( #15 (comment) ),本篇指南将指导您如何使用 Cloudflare Workers 进行反代,代替
core.php
文件。1、拥有一个 Cloudflare 账户
2、创建一个 Workers
HTTP handler/HTTP 处理程序
,然后 Create service:3、载入代码
4、新建并绑定 KV
statuslive
,KV Namespace 选择刚刚创建的 KV 命名空间,随后点击 Save and deploy 按钮;(可选)5、绑定自己的域名
完成!
现在,将您的 Workers 域名填写到
conf.json
的config_proxy_link
字段即可。或者,将其作为环境变量,进行 build & deploy。
Beta Was this translation helpful? Give feedback.
All reactions