It seems that everybody's favourite golang learning exercise is to write a URL shortener. This project intents to have the following differences from similar projects:
- Coded with a "'''main.go'''" file that uses functionality in a library.
- Designed to be deployed on heroku.
- Configurable to shorten ULRs from specific sites.
- Attempts to retrieve configuration values from environment using heroku's conventions and then from a configuration file.
Shorting a URL:
curl http://localhost:8080/short/ --data-urlencode "u=http://www.mistriotis.com" -v
Run
go get .
in order to retrieve all external dependencies, which should be:
- Gorilla Mux
- godis - a Redis client for Go
TODO
Environment variables:
- HOSTNAME: Hostname from which the service should return responses.