DEV Community

Cover image for GOlang URL shortener service using postgres, redis, bulma
J
J

Posted on • Updated on

GOlang URL shortener service using postgres, redis, bulma

You can use it via the mobile friendly web UI or automate it with API already provided. I'm also thinking of building a browser extension to shorten any URL in a click (context menu for example).

Usage

Just visit urlssh.xyz. You can also integrate API for programmatic usage.

PS: https://urlssh.xyz/6OTMTS is short link to this article 😎

GitHub logo adhocore / urlsh

GOlang URL shortener and bookmarker service with UI, API, Cache, Hits Counter and forwarder using postgres and redis in backend, bulma in frontend

urlsh

Latest Version Software License lint test Donate 15 Donate 25 Donate 50 Tweet

urlsh is URL shortener application built on Go language.

It does not use external libraries except the gorm for postgres database and minimal redis module redigo.

URLSH

Usage

Web client

Just visit urlssh.xyz. You can also integrate API for programmatic usage.

Terminal client

If you live inside the command line terminal, you can install a client:

go get github.com/adhocore/urlsh/cmd/urlshc
Enter fullscreen mode Exit fullscreen mode

Make sure $GOPATH or $HOME/go/bin is in your $PATH or %path%, then use it like so:

# show help
urlshc -h

# shorten a url
urlshc -url 'https://your.long.url/here'

# shorten a url with keywords and expiry date
urlshc -url 'https://your.long.url/here' -keywords 'word-1,word2' -expires '2022-12-31'

# if you have self hosted or local instance of urlsh, pass in URLSH_HOST (with domain only)
URLSH_HOST=https://your.urlsh-instance.com urlshc -url 'https://your.long.url/here'
Enter fullscreen mode Exit fullscreen mode

Read below for self hosting, API integration and/or contributing to urlsh.


Getting

Discussion (0)