GoTo: URL Shortener
An implementation of https://github.com/kellegous/go. An internal focused URL shortener.
go get github.com/clintjedwards/goto
DNS/DHCP Setup
To enable functionality such as go/mylink
, you'll need two pieces of functionality.
- The application must be given an A record: Ex.
go.clintjedwards.home
- Through DHCP you must set up search domains that include the (example)
clintjedwards.home
domain
- Now simply typing
go/{something here}
will take you to your shortened link
API Documentation
Route |
Methods |
Payload |
Returns |
/links |
GET |
None |
[{url, id, hits, created}] |
/links/{id} |
GET, DELETE |
None |
{url, id, hits, created}, nil |
/create |
POST |
{url, id} |
{url, id, hits, created} |
/{id} |
GET |
None |
302/Redirect |
Usage
Examples use httpie
http POST localhost:8080/create url=https://yahoo.com id=test
http GET localhost:8080/links
http GET localhost:8080/test
http GET localhost:8080/links/test
http DELETE localhost:8080/links/test
Reserved links
The following short names are reserved for app use: ["links", "create", "version", "status", "health", "edit", "api"]
Authors