*bin and URL Shortener with Cloudflare Workers + KV
- 3 * 24hr max TTL
- 25MB max
- assigned
binID
is randomly generated 5 character string- exclude commonly mistaken characters (
0oO1LlIi
...)
- exclude commonly mistaken characters (
Content-Type
sent is theContent-Type
returnedFile-Name
sent is the filename returned
- https://bin.mchang.workers.dev
- ShareX Config
curl --upload-file ./filename.txt https://bin.mchang.workers.dev/c/
{
"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",
}