URL shortener and redirect service designed for low-latency, read-heavy use.
- Go 1.22.*
- Docker Engine 20.*
- Docker Compose 2.*
Run the following command within the repository root to start container dependencies in the background:
docker compose up --detach cache database
Then, when the databases are ready to accept connections, start the server with go run .
.
curl http://localhost:8080/api/links \
--request POST \
--data '{"url": "http://example.com"}'
# {"url": "http://example.com", "slug": "<SLUG>" }
curl http://localhost:8080/<SLUG>
Run unit and integration tests with go test
after starting container dependencies.
GitHub Actions will run tests for every code push.
This URL shortener is unsuited for production use; it does not support logging or metric collection.