Skip to content

Latest commit

 

History

124 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go.dip.sh

URL shortener powered by a Cloudflare Worker with KV storage and a Bun-compiled CLI.

Environment variables

  • SHORTEN_BASE: Base URL of the deployed worker. Default: https://go.dip.sh
  • SHORTEN_USER: Name recorded as the creator (fallbacks: $USER, then "cli").

CLI

Build a single-file binary:

bun install
bun run build

Usage:

# Auto-generate slug
./shorten https://example.com

# Provide your own slug
./shorten https://example.com docs

# Interactive (no args)
./shorten

# Quiet mode (prints only the short URL)
./shorten https://example.com -q

Output (normal mode):

Created: https://go.dip.sh/abcdef12
QR SVG:  https://go.dip.sh/abcdef12.svg

Worker

  • Local dev:
bun run dev
  • Deploy:
bun run deploy

API

  • POST /api/shortlinks

    • body: { by: string, dest: string, slug?: string }
    • returns: { slug: string }
  • GET /:slug → 303 redirect to destination

  • GET /:slug.svg → QR code as SVG

About

Stupid simple link shortener on Cloudflare Workers

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages