Switch branches/tags
Nothing to show
Find file History
Latest commit 67fc6ba Dec 25, 2017
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
conf add examplde shorturl Dec 11, 2013
controllers Fix-import-path Jul 6, 2017
models add examplde shorturl Dec 11, 2013
tests add examplde shorturl Dec 11, 2013
README.md Update README.md Dec 25, 2017
README_ZH.md fix typo Dec 11, 2013
main.go Fix-import-path Jul 6, 2017

README.md

Shorturl

中文文档

This sample is a API application based on beego. It has two API func:

  • /v1/shorten
  • /v1/expand

Installation

cd $GOPATH/src/samples/shorturl
bee run

Usage:

# shortening url example
http://localhost:8080/v1/shorten/?longurl=http://google.com

{
  "UrlShort": "5laZG",
  "UrlLong": "http://google.com"
}

# expanding url example
http://localhost:8080/v1/expand/?shorturl=5laZG

{
  "UrlShort": "5laZG",
  "UrlLong": "http://google.com"
}