https://github.com/jakejarvis/shortty
🩳 A very, very simple link shortener. Maybe too simple, quite frankly.
https://github.com/jakejarvis/shortty
bitly cloudflare cloudflare-kv cloudflare-workers hono link-shortener serverless starter-template typescript url-shortener
Last synced: 2 months ago
JSON representation
🩳 A very, very simple link shortener. Maybe too simple, quite frankly.
- Host: GitHub
- URL: https://github.com/jakejarvis/shortty
- Owner: jakejarvis
- License: mit
- Created: 2025-04-03T19:06:19.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-27T19:09:32.000Z (5 months ago)
- Last Synced: 2026-01-29T15:56:41.708Z (5 months ago)
- Topics: bitly, cloudflare, cloudflare-kv, cloudflare-workers, hono, link-shortener, serverless, starter-template, typescript, url-shortener
- Language: TypeScript
- Homepage: https://jrvs.io/shortty
- Size: 36.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🩳 shortty
A very, _very_ simple (less than 100 LoC, for whatever that's worth) link shortener powered by [Cloudflare Workers](https://workers.cloudflare.com/) and [Hono](https://hono.dev/).
## Setup
[The docs are pretty much already written...](https://developers.cloudflare.com/workers/wrangler/) But essentially:
1. Create a Cloudflare KV store: `npx wrangler kv namespace create my-links`
1. Update [wrangler.jsonc](wrangler.jsonc) with that namespace's ID, your worker's name, and your own domain.
1. Set a random authentication token: `npx wrangler secret put BEARER_TOKEN`
1. Deploy: `npx wrangler deploy`
## Usage
There is **no GUI**. Quite literally everything is done via `curl` requests in your terminal (hence the name).
### Add a link with a _**random**_ shortcode
```sh
curl -X POST \
-H "Authorization: Bearer " \
-H "URL: https://ubuntu.com/download/server/thank-you?version=24.04.2&architecture=amd64<s=true" \
https://jrvs.io
```
### Add a link with a _**specific**_ shortcode
```sh
curl -X PUT \
-H "Authorization: Bearer " \
-H "URL: https://github.com/jakejarvis/shortty/blob/main/README.md" \
https://jrvs.io/readme
```
### Delete a link
```sh
curl -X DELETE \
-H "Authorization: Bearer " \
https://jrvs.io/readme
```
### List all links
Soon, maybe. 🤷♂️
## License
[MIT](LICENSE)