cacoco / smally-scala

URL shortener in Scala using Finagle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

URL shortener in Scala using Finagle

License:Apache License 2.0


Languages

Language:Scala 100.0%