An API to create Heroku-like memorable random names for URLs
/api/create
Parameters: url
(the original URL to be shortened) and password
(optional)
Response: short memorable id (to be used while retrieving)
/api/view/:id
Parameters: password (if required)
Response: the original URL that was shortened
/api/open/:id
Parameters: password (if required)
Response: redirect to the original URL that was shortened
http://shoutlink.herokuapp.com/api/create?url=http://google.com
http://shoutlink.herokuapp.com/api/open/blue-bird
http://shoutlink.herokuapp.com/api/create?url=http://github.com&password=test
http://shoutlink.herokuapp.com/api/view/dawn-cloud?password=test
Install PostgreSQL, and create a database using CREATE DATABASE mydb;
To start the server, run:
bundle install
bundle exec rackup
Replace the hostname in the examples with localhost:9292
for local development.