A simple and fast URL shortener service built with Go and Fiber.
- ✅ Shorten long URLs
- ✅ Custom short codes
- ✅ Click tracking
- ✅ URL statistics
- ✅ Duplicate URL detection
- ✅ SQLite database storage
- Go 1.25+ installed
- Git
git clone https://github.com/ImanMontajabi/Linkverkuerzer.git
cd Linkverkuerzer
go mod tidy
go run .The server will start at http://localhost:3000
| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Health check |
| POST | /shorten |
Create short URL |
| GET | /:code |
Redirect to original URL |
| GET | /stats/:code |
Get URL statistics |
| GET | /urls |
List all URLs |
curl -X POST http://localhost:3000/shorten \
-H "Content-Type: application/json" \
-d '{"url": "https://www.google.com"}'curl -L http://localhost:3000/abc123curl http://localhost:3000/stats/abc123Set environment variables:
export PORT=3000
export DATABASE_URL=./urls.db
export BASE_URL=http://localhost:3000
export SHORT_CODE_LENGTH=6
export MAX_URL_LENGTH=2048├── main.go # Application entry point
├── handlers.go # HTTP request handlers
├── service.go # Business logic
├── models.go # Data structures
├── database.go # Database operations
├── config.go # Configuration management
└── utils.go # Helper functions
MIT License