GitXplorerGitXplorer
c

smally-scala

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.

No commits found

There are no commits on branch master.

README

The README file for this repository.

smal.ly

Simple URL shortener in Scala using Finagle

Running

To run:

mvn scala:run

or optionally to run with debugging enabled (on port 5005 by default):

mvn scala:run -Pdebug

To run unit tests:

mvn test

Using

To create a new shortened url:

curl -i {host}:{port}/?url=www.to.shorten

e.g.,

[~] ➔ curl -i "http://localhost:9090?url=https://www.twitter.com"
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 41

{"smally-url" : "localhost:9090\/9h5k1"}

To use a shortened url:

curl -i {host}/{shortened-url}

e.g.,

[~] ➔ curl -i "http://localhost:9090/9h5k1"
HTTP/1.1 302 Found
Location: https://www.twitter.com
Content-Length: 0

Or paste the shortened url into your browser.