A simple Go web application that counts hits on external URLs and then redirects to the destination.
The URL used looks like:
/g?url=http%3A%2F%2Fexample.com
Note that to redirect externally the URL must start with the protocol.
The functionality is based on a whitelist - if the URL isn't stored in the database the service will serve a 404.
There is currently no API for adding, removing, or fetching counts of hits.
The service uses GNU Make to run:
make runruns the service onlocalhost:8080make testruns the Go testsmake buildrunsgo buildwith theGOPATHcorrected to include vendorised dependencies. This generates a binary file calledexternal-link-tracker
The service depends on MongoDB.