Simple URL shortener made with Go, Echo and Redis
# Clone the repository
git clone https://github.com/weirdvic/zetahedron.git
# Run the app
docker compose up --build --detach
By default the app will be listening on http://localhost:1323
Try to shorten an URL.
Request params:
url
— an URL to shorten
url_slug
— optional short URL slug
expiry
— optional short link expiration time in hours
Example request:
curl -s -X POST -H 'Content-Type: application/json' \
-d '{"url":"https://thebestmotherfucking.website/"}' \
http://localhost:1323/shorten
Example output:
{
"url": "https://thebestmotherfucking.website/",
"short_url": "http://localhost:1323/mpdN0iJlZ0h",
"expiry": 24
}
Try to resolve short URL slug to the original URL
Request params: none, short URL provided in request path
Example request:
curl -Ls -w %{url_effective} -o /dev/null http://localhost:1323/mpdN0iJlZ0h
Example response:
https://thebestmotherfucking.website/