Burry is a lightweight URL shortener written in Go. It allows you to shorten URLs, store them in a cache and use the short link to be redirected to the original URL. The service has been tested with Redis and Garnet as caching solutions.
- Shorten URLs: Create shorter versions of long URLs.
- Cache Storage: Store shortened URLs in a cache for quick retrieval.
- Redirection: Redirect to the original URL using the shortened link.
- Deployable: Can be run using Docker Compose or in a Kubernetes cluster.
Create a shortened URL.
Request:
{
"long_url": "https://example.com"
}
Response:
{
"short_url": "https://<your-domain>/<shortlink>"
}
Redirect to the original URL.
- Go 1.15+
- Docker
- Docker Compose
- Kubernetes (optional)
REDIS_ADDR
: The address of the cache (e.g. redis or garnet) server (e.g.,localhost:6379
).
-
Clone the repository:
git clone https://github.com/gerrited/burry.git cd burry
-
Start the services:
docker-compose up --build
-
Clone the repository:
git clone https://github.com/gerrited/burry.git cd burry
-
Set up the environment variable in your Kubernetes configuration:
env: - name: REDIS_ADDR value: "redis-service:6379"
-
Deploy the service:
kubectl apply -f k8s/
The app runs on port 8080.
curl -X POST -H "Content-Type: application/json" -d '{"long_url": "https://example.com"}' https://<your-domain>/shorten
Navigate to https://<your-domain>/<shortlink>
in your browser.
Contributions are welcome! Please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.