Shorten url service written in GO.
Shorten your input url.
curl -X POST -H "Content-Type: application/json" \
-d '{"url": "http://yulun.me"}' \
'http://localhost:3000/api/v1/urls'
{
"id":1,
"url": "http://yulun.me",
"code": "1pBnf",
"hits": 0,
"created_at": "2015-01-19T01:00:24+08:00"
}
Get short code's information.
curl 'http://localhost:3000/api/v1/urls/1pBnf'
{
"id":1,
"url":"http://yulun.me",
"code":"1pBnf",
"hits":1,
"created_at":"2015-01-19T01:00:24+08:00"
}
Redirect to url by assigned short code with status 301.
Short code chars: abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
Demo site powered by Heroku