Requires sbt.
sbt run
The server will run at http://localhost:8080
Expects a string containing a well-formed URL, returns the shortened path.
Example:
curl http://localhost:8080/shorten --data 'http://google.com'
Expects the shortened path (eg "jX3L2wc") and returns the long URL.
Example:
curl http://localhost:8080/getUrl --data 'jX3L2wc'
Expects the shortened path (eg "jX3L2wc") and returns the number of times the link has been used.
Example:
curl http://localhost:8080/getClicks --data 'jX3L2wc'
Redirects to the URL given the shortened path.
Example (really you should use your browser):
curl -L http://localhost:8080/jX3L2wc