Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 743 Bytes

README.md

File metadata and controls

33 lines (27 loc) · 743 Bytes

URL SHORTENER

Простенький сокращатель ссылок

Local start

go run cmd/url_shortener/main.go

Request examples

Create short url

curl -v -X POST -d '{"url": "https://google.com"}' -H 'content-type: application/json' localhost:3000/api/v1/shorten

Get info by short url

curl -v localhost:3000/api/v1/shorten/{shortCode}

Update url

curl -v -X PUT -d '{"url": "https://microsoft.com"}' -H 'content-type: application/json' localhost:3000/api/v1/shorten/{shortCode}

Destroy url

curl -v -X DELETE -H 'content-type: application/json' localhost:3000/api/v1/shorten/{shortCode}

Go to original url by short code

curl -v localhost:3000/{shortCode}