Skip to content

general-CbIC/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener

Simple url shortener written on ruby using em-hiredis and sinatra. Needs to redis be installed.

Run with:

$ bundle
$ rake

Usage example:

$ curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"longUrl": "https://google.com"}' \
  http://localhost:1234/

Answer:

{"url":"http://localhost:1234/1X8jx44s"}

Trying link:

$ curl -i http://localhost:1234/1X8jx44s

HTTP/1.1 301 Moved Permanently
Content-Type: text/html;charset=utf-8
Location: https://google.com
Content-Length: 0
Connection: keep-alive
Server: thin

About

simple links shortener

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages