Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mchangrh/cfkv-bin
Cloudflare KV Bin
https://github.com/mchangrh/cfkv-bin
cloudflare-kv cloudflare-workers pastebin temporary-bin temporary-files url-shortener
Last synced: 3 months ago
JSON representation
Cloudflare KV Bin
- Host: GitHub
- URL: https://github.com/mchangrh/cfkv-bin
- Owner: mchangrh
- License: mit
- Created: 2021-12-19T23:31:42.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-15T04:03:25.000Z (5 months ago)
- Last Synced: 2024-10-04T22:42:49.489Z (3 months ago)
- Topics: cloudflare-kv, cloudflare-workers, pastebin, temporary-bin, temporary-files, url-shortener
- Language: TypeScript
- Homepage: https://bin.mchang.workers.dev
- Size: 74.2 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Temporary *bin & URL Shortener
*bin and URL Shortener with Cloudflare Workers + KV## Specifics
- 3 * 24hr max TTL
- 25MB max
- assigned `binID` is randomly generated 5 character string
- exclude commonly mistaken characters (`0oO1LlIi`...)
- `Content-Type` sent is the `Content-Type` returned
- `File-Name` sent is the filename returned## Hosted
- https://bin.mchang.workers.dev
- [ShareX Config](docs/cfkv-bin.sxcu)
- `curl --upload-file ./filename.txt https://bin.mchang.workers.dev/c/`## API Docs (also at /api)
```json
{
"version": 1,
"/b/:binID/:?filename.ext/:?method": {
"methods": {
"POST/PUT": {
"description": "Update contents of a bin",
"request": "File in body as binary",
"response": "Nothing (Status Code 200)"
},
"GET": {
"description": "Get contents of a bin",
"response": "Contents of bin"
},
"DELETE": {
"description": "Delete a bin",
"response": "Nothing (Status Code 200)"
},
"DOWNLOAD": {
"description": "Download a bin (only in path)",
"response": "Contents of bin (prompt download)"
}
},
"Headers": {
"Content-Type": "Content type of the body",
"File-Name": "Name of the file"
},
":?filename.ext": "Name of the file (optional), can force filename in /download",
":?method": "see methods"
},
"/b": {
"methods": {
"POST/PUT": {
"description": "Create a new bin",
"request": "File in body as binary",
"response": "binID"
}
}
},
"/c": {
"methods": {
"PUT": {
"description": "Create a new bin with curl -T/ --upload-file syntax",
"response": "https://host/:binID/:filename.ext"
}
},
},
"/u/:binID/:?method": {
"description": "see /b/:binID",
},
"/u": {
"methods": {
"POST/PUT": {
"description": "Create a new bin",
"request": "url body as raw text or searchParam url",
"response": "binID"
}
}
},
"/": "/api",
"/ping": "pong",
"/upload": "mchangrh.github.io/cfkv-bin",
"/editor": "mchangrh.github.io/cfkv-bin/editor",
"/version": "short git commit id",
"/github": "https://github.com/mchangrh/cfkv-bin",
"/api": "this",
}
```