Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1002 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 1002 Bytes

yaus

Go Report Card Go Reference


yaus (Yet Another URL Shortener) is a simple URL shortener used to demonstrate some handy patterns to develop Go services.

It currently offers two endpoints:

  1. /shorten: to get a "shortened" hash
curl --request POST \
  --url http://localhost:8080/shorten \
  --header 'Content-Type: application/json' \
  --data '{
	"url": "http://www.google.it"
}'
{"hash":"dda15434615ed3debc02fef8bbea9236"}
  1. /{hash}: to get the proper redirect from the given "shortened" URL
$ curl --request GET \
  --url http://localhost:8080/dda15434615ed3debc02fef8bbea9236
<a href="http://www.google.it">Temporary Redirect</a>.