https://github.com/pippolo84/yaus
A simple URL shortener to demonstrate Go services patterns
https://github.com/pippolo84/yaus
go golab http service
Last synced: 11 months ago
JSON representation
A simple URL shortener to demonstrate Go services patterns
- Host: GitHub
- URL: https://github.com/pippolo84/yaus
- Owner: pippolo84
- License: apache-2.0
- Created: 2021-03-23T19:17:12.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-24T22:11:05.000Z (almost 5 years ago)
- Last Synced: 2025-01-23T15:17:04.360Z (about 1 year ago)
- Topics: go, golab, http, service
- Language: Go
- Homepage: https://golab.io/en/agenda/your-first-go-project/
- Size: 282 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yaus
[](https://goreportcard.com/report/github.com/pippolo84/yaus)
[](https://pkg.go.dev/github.com/Pippolo84/yaus)
yaus (**Y**et **A**nother **U**RL **S**hortener) 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"}
```
2) `/{hash}`: to get the proper redirect from the given "shortened" URL
```
$ curl --request GET \
--url http://localhost:8080/dda15434615ed3debc02fef8bbea9236
Temporary Redirect.
```