1
mirror of https://github.com/jakejarvis/shortty.git synced 2025-04-25 08:25:23 -04:00
2025-04-03 15:59:21 -04:00
2025-04-03 15:59:21 -04:00
2025-04-03 15:59:21 -04:00
2025-04-03 15:59:21 -04:00
2025-04-03 15:59:21 -04:00
2025-04-03 15:59:21 -04:00
2025-04-03 15:59:21 -04:00
2025-04-03 15:59:21 -04:00
2025-04-03 15:59:21 -04:00
2025-04-03 15:59:21 -04:00

🩳 shortty

A very, very simple (less than 100 LoC, for whatever that's worth) link shortener powered by Cloudflare Workers and Hono.

Setup

The docs are pretty much already written... But essentially:

  1. Create a Cloudflare KV store: npx wrangler kv namespace create my-links
  2. Update wrangler.jsonc with that namespace's ID, your worker's name, and your own domain.
  3. Set a random authentication token: npx wrangler secret put BEARER_TOKEN
  4. Deploy: npx wrangler deploy

Usage

There is no GUI. Quite literally everything is done via curl requests in your terminal (hence the name).

curl -X POST \
  -H "Authorization: Bearer <BEARER_TOKEN>" \
  -H "URL: https://ubuntu.com/download/server/thank-you?version=24.04.2&architecture=amd64&lts=true" \
  https://jrvs.io
curl -X PUT \
  -H "Authorization: Bearer <BEARER_TOKEN>" \
  -H "URL: https://github.com/jakejarvis/shortty/blob/main/README.md" \
  https://jrvs.io/readme
curl -X DELETE \
  -H "Authorization: Bearer <BEARER_TOKEN>" \
  https://jrvs.io/readme

Soon, maybe. 🤷‍♂️

License

MIT

Languages
TypeScript 100%