This is a simple URL shortener written in Go using MySQL and Redis.
- Clone the repository
- Execute sql script in
data/init.sql
- run
> go build cmd/app
> app -config configs/config.yaml
- create a new short url
curl -X POST \
http://127.0.0.1:8090/api/url \
-H 'Content-Type: application/json' \
-d '{
"url":"https://github.com/v0ker/ShortURL",
"ttl": 300
}'
- Open the short url from action 3 in browser