go run .The server listens on :8080. Mint a short link:
curl -s -X POST localhost:8080 -d '{"url":"https://example.com"}'
# {"short":"http://localhost:8080/1a2b3c4d"}Follow it — a 302, with the original URL in Location:
curl -i localhost:8080/1a2b3c4d- POST a JSON body with a
urlkey, get{"short": "..."}back. - GET
/<code>redirects, or answers 404. - Codes are 4 random bytes as hex — eight characters.
- State is a map behind a
sync.RWMutex, so concurrent POSTs cannot corrupt it.
go test ./...
gofmt -l . # should print nothing
go vet ./...Links live in memory (#7), there is no expiry (#8), no rate limit (#9), and the scheme is hardcoded to http (#6). Those are open issues, not surprises — pick one up.
Humans and automated agents are both welcome. There is no CLA — every commit carries a DCO sign-off (git commit -s).
Start with a good first issue, or read CONTRIBUTING.md.
GPL-2.0-or-later — see LICENSE. Copyright (C) 2026 Marcus Beauregard.
