无服务器 自建短链服务 Url-Shorten-Worker 完整的部署教程

https://sd.oktv.eu.org/

https://github.com/crazypeace/Url-Shorten-Worker
演示
短链系统 https://1way.eu.org/bodongshouqulveweifengci

网络记事本 Pastebin https://pastebin.icdyct.cloudns.asia/tieludasiliqiuweiyue

图床 Image Hosting https://imghost.crazypeace.workers.dev/imghostimghost

网络日记本 NetJournal 支持Markdown https://journal.crazypeace.workers.dev/journaljournal

完整的部署教程
https://zelikk.blogspot.com/2022/07/url-shorten-worker-hide-tutorial.html

源码 GitHub: https://github.com/crazypeace/Url-Shorten-Worker

申请Cloudflare账号,略。
创建一个KV
记得这个KV的名字,以 urlsrv 为例

查看此KV

添加一个条目Entry
密钥key为password,值value为一个随机字符串.

  • password这个key是在脚本中要引用的,所以要设置这个。

随机字符串可以使用http://git.io/xkcdpw生成

随机字符串以 yejiandianci 为例

创建Worker服务

设置绑定KV

变量名称必须设置为 LINKS, KV的名字选刚刚创建的 urlsrv

  • LINKS 是在脚本中要引用的,所以要设置这个。换句话说,如果你使用别的脚本,可能这个变量名称就不是LINKS了。

编辑Worker的脚本

把原有的内容全部删掉

换成:https://github.com/crazypeace/Url-Shorten-Worker/blob/main/worker.js 的内容
保存并部署

======

如果要当网络记事本 PasteBin

如果要当图床 Image Hosting

如果要当网络日记本, 支持MarkDown

======

要访问 你的worker域名/yejiandianci 来打开使用页面

如:https://snowy-disk-fd82.ciys.workers.dev/yejiandianci

======

后记
你可以通过在你自己的域名下worker页面添加一个路由指向worker的方式来实现比如 https://1way.eu.org/mtSzm6 替代 snowy-disk-fd82.ciys.workers.dev/yejiandianci 的效果。

======

开发记录
直接访问域名返回404。在KV中设置一个entry,保存秘密path,只有访问这个path才显示使用页面。

https://zelikk.blogspot.com/2022/07/url-shorten-worker-hide-tutorial.html

支持自定义短链

https://zelikk.blogspot.com/2022/07/url-shorten-worker-custom.html

API 不公开服务

https://zelikk.blogspot.com/2022/07/url-shorten-worker-api-password.html

页面缓存设置过的短链

https://zelikk.blogspot.com/2022/08/url-shorten-worker-localstorage.html

长链接文本框预搜索localStorage

https://zelikk.blogspot.com/2022/08/url-shorten-worker-bootstrap-list-group-oninput.html

增加删除某条短链的按钮

https://zelikk.blogspot.com/2022/08/url-shorten-worker-delete-kv-localstorage.html

访问计数功能 可查询短链 成为功能完整的短链API系统

https://zelikk.blogspot.com/2023/11/url-shorten-worker-visit-count-api-api.html

阅后即焚功能, 可制作一次性二维码

https://zelikk.blogspot.com/2023/11/url-shorten-worker-snapchat-mode.html

增加读取 KV 中全部记录的功能

https://zelikk.blogspot.com/2024/01/url-shorten-worker-load-cloudflare-kv.html

变身网络记事本 Pastebin

https://zelikk.blogspot.com/2024/01/url-shorten-worker-pastebin.html

变身图床 Image Hosting

https://zelikk.blogspot.com/2024/01/url-shorten-worker-image-hosting-base64.html

变身日记本 NetJournal 支持Markdown

https://zelikk.blogspot.com/2024/02/url-shorten-worker-netjournal.html

https://zelikk.blogspot.com/2024/02/url-shorten-worker-netjournal-markdown.html

点击标签看相关内容: CloudFlare KV Shorten url Url-Shorten-Worker worker workers

https://www.youtube.com/watch?v=hx-PjiM8gB0
【2024永久免费的缩短网址教程】无需VPS,通过cloudflare的workers创建一个专属的缩短网址的短连接网站,可自定义后缀,部署简单快捷,0基础小白也能独立完成 #shorturllink-科技KKK
首播开始于2023.3.8
优秀的github开源项目不应该被埋没:https://github.com/crazypeace/Url-Shorten-Worker
CF大善人注册一个账号:https://dash.cloudflare.com/
github项目: 部署代码 https://raw.githubusercontent.com/crazypeace/Url-Shorten-Worker/main/worker.js
演示参考网站: https://sd.cloudflarest.link/dlj
namesoli10元以下的域名购买(优惠码kjkkk): https://www.namesilo.com/domain/search-domains?rid=b588869yo
5元每月的AC云VPS购买: https://www.anyfastcloud.com