Jabong's Url Shortener
- Download the archive from here
- Go to the folder containing downloaded file using terminal
- Extract the file into /usr/local,creating a go tree in /usr/local/go by typing
For example if you are installing Go version 1.2.1 for 64-bit x86 on Linux.
tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
tar -C /usr/local -xzf go1.2.1.linux-amd64.tar.gz
- Add environment variables in .bashrc file
- Go to $HOME direcitory by typing
cd
- Open .bashrc file
vi .bashrc
�
- Place these lines in the end of the file(.bashrc)
export GOROOT=/usr/local/go export GOPATH=$HOME/lilliput export PATH=$PATH:$GOROOT/bin:$GOPATH/bin export PATH=$PATH:$GOPATH/bin
- Save and exit the file. Press "Esc" and then :wq
- Source the .bashrc file
source .bashrc
- Test your installation by typing
go version
git clone https://github.com/jabong/lilliput
git branch "branchname"
git checkout "branchname"
git checkout -b "branchname"
make depends
make build
[lilliput]
// port number on which lilliput will be running
port = 8989
// domain name which will be prepend in tinyurl
domain = "http://jbo.ng/"
[redis]
server = "127.0.0.1"
port = "6379"
dbname = 0
shell> curl --data "url=http://google.com" http://jbo.ng/
{
"url": "http://jbo.ng/vmePlru",
"err": false,
"message": ""
}