Shrty is a simple to use, go based link shortner with api connection.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
kreativmonkey 2fcd341fd9 Testing and Link disolve Close #8 8 years ago
shrty Testing and Link disolve Close #8 8 years ago
template Close #1 8 years ago
.gitignore Testing and Link disolve Close #8 8 years ago
LICENSE Initial commit 8 years ago
README.md Rename? 8 years ago
api.go Testing and Link disolve Close #8 8 years ago
config.go Testing and Link disolve Close #8 8 years ago
config_test.go Global Config Close #3 8 years ago
handlers.go Testing and Link disolve Close #8 8 years ago
main.go Testing and Link disolve Close #8 8 years ago
routs.go Testing and Link disolve Close #8 8 years ago

README.md

Sgot

Sgot is a lightwaight, self-hostable open-source link shortening web application with a Restful API. It allows you to host your own URL shortener to gain control over you data. Shrt is inspired by Polr, a php based url shortener.

Features

  • No duplicated URL
  • Simple UI
  • Simple database Json file
  • Restful API
  • Simple Click Statistik
  • Delete URL
  • Login

API

To authenticate a user to Polr, you will need to provide an API key along with each request to the Polr API, as a GET or POST parameter. (e.g ?key=API_KEY_HERE)

/api/v1/action/shorten

Arguments:

  • url: the URL to shorten (e.g https://google.com)
  • custom_ending [not now supported] (optional): a custom ending for the short URL. If left empty, no custom ending will be assigned.

Short an URL

GET: http://example.com/api/action/shorten?key=API_KEY_HERE&url=http://example.de/shortening/main?q=5x

Response: 
{ "action": "shorten",
  "result": "https://example.com/5kq" }

/api/v1/action/lookup

Arguments:

  • url_ending: the link ending for the URL to look up. (e.g 5ga)

Lookup for existing URL

GET: http://example.com/api/action/lookup?key=API_KEY_HERE&url_ending=5kq

Response: 
{ "action":"lookup",
  "result": {
        "long_url": "http://example.de/shortening/main?q=5x",
        "created_at": "2017-05-12 22:48:40.997520107 +0200 CEST",
        "clicks":"0" 
        }
}

ToDo

  • Add more Statistik details like the clicks from Country and Referer.
  • Implements the correct HTTP Error Codes
  • Add config File
  • Secure the API with API Key [optional]