This is a URL shortener service written in Go. It powers v0v.cc
.
To shorten a URL, send a POST request with it as the url field in the body. For example, to shorten https://google.com
, run:
$ curl -d "url=google.com&auth=XXX" v0v.cc
where the output is v0v.cc/BST
. auth
is the authentication code needed. If the URL given does not have a scheme, then it is assumed to be https. Internationalized hostnames are supported.
URLs are redirected using 301 Permanent redirects.
Install the bolt library using:
go get "github.com/boltdb/bolt"
Initalized your config like config.go.example
. Run
go build server.go config.go -o shortener
It probably requires root privileges.
This project is released into the public domain. Favicon used under Creative Commons, no attribution license.