Skip to content

iantabolt/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener

Running

Requires sbt.

sbt run

The server will run at http://localhost:8080

Endpoints

POST /shorten

Expects a string containing a well-formed URL, returns the shortened path.

Example:

curl http://localhost:8080/shorten --data 'http://google.com'

POST /getUrl

Expects the shortened path (eg "jX3L2wc") and returns the long URL.

Example:

curl http://localhost:8080/getUrl --data 'jX3L2wc'

POST /getClicks

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'

GET /[shortened path]

Redirects to the URL given the shortened path.

Example (really you should use your browser):

curl -L http://localhost:8080/jX3L2wc

About

A URL shortener service with spray

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages