CouchDB url shortener
This couchapp (CouchDB design doc) is an API for url shortening.
The couchapp provides mainly two services on the API endpoint
- create a short URL (~20 characters) that points to the longer URL
- redirect/forward every request of the short URL to the longer URL
You may want to read the full story. Finally you can read the commit/tag history to review the implementation details.
Clone the repo and enter the directory.
$ couchapp push http://admin:password@couchdbdomain:port/databasename
Upload the couchapp. Alternatively upload targets can be defined in the
The repo contains a test shorturl doc which will uploaded automatically with the couchapp. To test the installation request
http://couchdbdomain:port/databasename/_design/urlshortener/_rewrite/url/test-url - it should forward you to the blog post.
Because thats a huuuge URI you may also want to enable a vhost in the local.ini.
//subdomain without endpoint path [vhosts] sub.domain.tld=databasename/_design/urlshortener/_rewrite/url //subdomain with endpoint path [vhosts] sub.domain.tld=databasename/_design/urlshortener/_rewrite
Also, you can change the API endpoint paths in the
get in touch
Feel free to open issues, comment code lines ... it's a maintained thing I am llabball in twitter.