A lightweight URL shortener service built with Bun. Creates short URLs in the format example.com/shortname
that redirect to their target URLs.
- Create short URLs via web form at
/new
(or whatever you specify) - Permanent (301) redirects
- File-based storage (no database required)
- Simple password protection for URL creation
- Clean, mobile-friendly interface
- Bun runtime
Add the following to your .env
file:
PORT=411
URLS_DIR=urls
ADD_PATH=new
PASSWORD=your-password
MAIN_REDIRECT=https://example.com
RATE_LIMIT_MAX=10
RATE_LIMIT_TIME=1
To run:
bun run index.ts
Best place to host is something like Digital Ocean. Set up a droplet and deploy the app there.
If I get around to it, dropship will be an amazing CLI to deploy to a droplet. But it's not ready yet!
This project was created using bun init
in bun v1.1.27. Bun is a fast all-in-one JavaScript runtime.