白嫖 worker 自建短链服务 Url-Shorten-Worker 完整的部署教程
源码 GitHub https://github.com/crazypeace/Url-Shorten-Worker
演示站 https://urlsrv.crazypeace.workers.dev/bodongshouqulveweifengci
申请 Cloudflare 账号,略。
创建一个 KV
记得这个
设置绑定 KV
编辑 Worker 的脚本
把原有的内容全部删掉
换成:https://github.com/crazypeace/Url-Shorten-Worker/blob/main/worker.js 的内容
注意脚本的第 2 行, 这里的系统的使用密码.
我在这里以 yejiandianci 为例, 你可以使用足够长的随机字符串. 可以用 http://git.io/xkcdpw 生成随机密码
保存并部署
完
要访问 你的如:https://snowy-disk-fd82.ciys.workers.dev/yejiandianci
======
后记
你可以通过在你自己的域名下
======
配置参数的作用
const config = {password: "testpassword", // 管理面板使用密码 // if password != null, then use this config; otherwise, read password from KV.result_page: false, // 是否用特定的result 页面来显示 value // After get the value from KV, if use a page to show the result. theme: "", // 管理面板的主题 // Homepage theme, use the empty value for default theme. To use urlcool theme, please fill with "theme/urlcool" .cors: true, // 是否允许CORS 使用 API // Allow Cross-origin resource sharing for API requests. unique_link: false, // 一个长链是否只有唯一的短链(会增加写入的使用量) // If it is true, the same long url will be shorten into the same short url custom_link: true, // 允许自定义短链 // Allow users to customize the short url.overwrite_kv: false, // 允许覆盖已存在的key // Allow user to overwrite an existed key. snapchat_mode: false, // 短链只能访问一次(访问后就删除了) // The link will be distroyed after access. visit_count: false, // 使用记数(会大大增加写入的使用量, 多人共用不推荐打开) // Count visit times. load_kv: false, // 从KV 加载全部数据 (自用推荐打开, 多人共用会看到别人的数据) // Load all from Cloudflare KV system_type: "shorturl", // 系统的功能定义 // shorturl, imghost, other types {pastebin, journal}}
======
如果要当网络记事本 PasteBin
演示站 https://pastebin.crazypeace.workers.dev/tieludasiliqiuweiyue
演示视频 https://www.youtube.com/watch?v=toBeb3DNpZc
======
如果要当图床 Image Hosting
演示站 https://imghost.crazypeace.workers.dev/imghostimghost
演示视频 https://www.youtube.com/watch?v=B7wH4tB1-O8
======
如果要当网络日记本, 支持
评论
发表评论