For the purposes of this tutorial, we have specially prepared an example application for you to follow along with. You can download Squish from Github. Squish is a simple URL shortener implemented with Couchbase.
To get started, lets first get the source code. Open up a new Terminal window and type the following:
shell> git clone git://github.com/couchbaselabs/couchbase-squish.git shell> cd couchbase-squish shell> bundle install
Now that you have the source and all of the dependencies, we can start the application and see what's happening.
shell> rails serverIn a URL shortening application there are a number of features we would like to accomplish. Let's define what they are:
User should be able to save a valid URL. client.set
User can visit the shortened URL and is redirected to the long one. client.get
A user visiting a URL should increment number of hits for a given URL. client.set