https://github.com/soxft/urlshorter-workers
A simple urlshorter based on Cloudflare worekrs
https://github.com/soxft/urlshorter-workers
Last synced: about 1 year ago
JSON representation
A simple urlshorter based on Cloudflare worekrs
- Host: GitHub
- URL: https://github.com/soxft/urlshorter-workers
- Owner: soxft
- License: mit
- Created: 2022-03-22T08:20:30.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-28T17:31:22.000Z (about 4 years ago)
- Last Synced: 2025-02-17T12:26:45.395Z (over 1 year ago)
- Language: JavaScript
- Size: 13.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Urlshorter-Workers
> A simple urlshorter based on cloudflare workers
# Useage
1. 在Cloudflare创建一个 `KV` 及 `Workers`
2. 修改`Workers`的变量, 将`KV 命名空间绑定` 中 `LINKS` 指向 1 中创建的KV
3. 将 `index.js` 中`config`对象的`passwd`修改为 您的密码
4. 上传`index.js` 至您的workers
# Api
> POST /
**请求试例**
```json
{
"url": "https://baidu.com",
"passwd": "default"
}
```
**期待返回**
```json
{
"code": 0,
"msg": "ok",
"short": "abcd"
}
```
# 参考
- [xyTom/Url-Shorten-Worker](https://github.com/xyTom/Url-Shorten-Worker)