Skip to content
/ tachi Public
forked from mrtazz/katana

Ready to go heroku hosted URL shortener based on guillotine

License

Notifications You must be signed in to change notification settings

FragD/tachi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tachi

Overview

Opinionated personal URL shortener which runs on Heroku and uses Redis to go as a backend. Shortening is done through the fabulous Guillotine engine and its Redis adapter.

All methods except shortened URL lookup GETs require JWT authentication.

Usage

You can use it exactly as any other guillotine app:

curl -X GET https://tachi-url-shortener.herokuapp.com/shorten -i -d"token=eyJ0eXAiOiJKV1QiLC6sbd0iOiJIUzI1NiJ9.IjVMWnUyR2czVzhOVHFKYk05SEhaTlNnZCI.no5LH7TYkss-jp7mqj9IywjZef5-r9JkzA2lVBbMijY" -d"url=http://somedomain.com/blah" -d"code=abcdef"

where https://tachi-url-shortener.herokuapp.com is your deployed heroku application hostname

Features

  • Authentication updated to use JWT authentication token
  • Custom GET endpoint

Setup

git clone git://github.com/FragD/tachi.git
cd tachi
heroku create
heroku addons:add redistogo
heroku domains:add zip.ed
heroku domains:add www.zip.ed
git push heroku master
# for authentication
heroku config:add JWT_ID="jbjadasdasdasd12321eas"
heroku config:add JWT_SECRET="908ADD8989adfvasdasdasdadad9897897987DAsASas"
# selected custom domain
heroku config:add SHORT_DOMAIN="zip.ed" 
# selected root domain to redirect to
heroku config:set ROOT_DOMAIN=https://www.website.com/ 

Custom Short Domain

To integrate a custom short domain you need to configure related DNS nameservers. e.g. Above zip.ed has been added as a custom domain, and configured using @AWS Route 53 Heroku configuration

API

There is a JSONP wrapped custom endpoint, you can add URLs with a GET supplying the following parameters:

https://tachi-url-shortener.herokuapp.com/shorten/?
token=eyJ0eXAiOiJKV1QiLC6sbd0iOiJIUzI1NiJ9.IjVMWnUyR2czVzhOVHFKYk05SEhaTlNnZCI.no5LH7TYkss-jp7mqj9IywjZef5-r9JkzA2lVBbMijY
&url=http://www.somelongdomain/1231231231
&callback=JSON_CALLBACK

Keep in mind that this endpoint is authenticated, JWT generated authentication token is required.

Thanks

@technoweenie for the awesome guillotine and @mrtazz for his katana development.

About

Ready to go heroku hosted URL shortener based on guillotine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%