shorten

command module
v0.0.0-...-1b2a494 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2019 License: MIT Imports: 15 Imported by: 0

README

url-shortener

Simple URL shortener backed by sqlite.

Using the API

    $ curl -X POST http://mydomain.com/api/save -d '{"url": "http://google.com"}'
    {"error":"","id":"M","url":"http://mydomain.com/123", "short_url": "123"}

    $ curl -X POST http://mydomain.com/api/save -d '{"url": "http://google.com", "shorturl": "abcd"}'
    {"error":"","id":"M","url":"http://mydomain.com/abcd", "short_url": "abcd"}

There's also a simple web ui available

Run in docker:
docker run -dv /local/data/path:/data \
    -p 1337:1337 \
    -e BASE_URL=http://mydomain.com \
    -e DB_PATH=/data \
    -e API_KEY=abcdefg \
    -e PORT=1337 \
    omropfryslan/shorten

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL