Skip to content

jsbugwang/cloudflare-workers-short-url

速览

我发布了一个 https://short.bugwang.workers.dev/rTJJPm,点击会 302 到 https://jsbug.wang/ 即表示成功了。

运行

$ wrangler dev

发布

注意 wrangler.toml 要修改:

type = "webpack"
$ wrangler publish

测试

1. 生成短链接

curl -d "{\"url\":\"https://jsbug.wang/\"}" "http://127.0.0.1:8787"

返回类似如下的 JSON :

{"code":0,"data":{"key":"QnjXCC"}}

2. 访问短链接

访问:http://127.0.0.1:8787/QnjXCC 会跳转到 https://jsbug.wang/ 即表示成功了。

这是一个绝好的项目! Test

About

Cloudflare Workers 短网址示例

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE_APACHE
MIT
LICENSE_MIT

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •