Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

kkfive/cf-shortlink-api

Repository files navigation

说明

基于CF Worker+KV搭建的简单短链程序,支持设置过期时间以及自定义KEY。

食用方案

  1. Fork此项目

  2. GitHub仓库中setting->Secrets添加两个字段CF_API_TOKENPASSWORD。分别表示cf的api key和请求api接口时的密钥

    • CF_API_TOKEN如果你不知道如何获取,那么请参考下文获取
    • PASSWORD请不要设置特殊字符

    image-20220731213642237

  3. 打开Actions(点击绿色按钮)

    image-20220731213120498

  4. 修改wrangler.toml文件的account_idkv_namespaces对应的ID

    • account_id就是点击worker时显示的账户id
    • kv_namespaces需要手动创建kv存储

    image-20220731213045086

  5. 不出意外的话,等待部署成功后即可使用

    如果没有触发actions的话,那么在无关代码的文件中 随意添加个空格换行,然后重写提交一次即可触发。

  6. 前端面板

    你可以选择自行搭建,也可以直接使用我的前端面板。地址:https://link.kkfive.top/

    image-20220731214210438

    image-20220731214303071

    image-20220731214343083

获取cf api token

获取API KEY:https://dash.cloudflare.com/profile/api-tokens

image-20220731212208358

image-20220731212233687

image-20220731212350229

图中文案写错,应该为API TOKEN 。其他不影响

获取KV存储的ID

image-20220731212739953

About

基于cf worker的简单短链服务

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

AltStyle によって変換されたページ (->オリジナル) /