Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 1.38 KB

README.md

File metadata and controls

47 lines (30 loc) · 1.38 KB

url-shortener

GitHub Actions Codecov

URL shortener and redirect service designed for low-latency, read-heavy use.

Usage

Requirements

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 ..

Shorten a URL

curl http://localhost:8080/api/links \
  --request POST \
  --data '{"url": "http://example.com"}'
# {"url": "http://example.com", "slug": "<SLUG>" }

Redirect a URL

curl http://localhost:8080/<SLUG>

Testing

Run unit and integration tests with go test after starting container dependencies.

GitHub Actions will run tests for every code push.

Deployment

This URL shortener is unsuited for production use; it does not support logging or metric collection.