DEV Community

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

GOlang URL shortener service using postgres, redis, bulma

Jitendra Adhikari
Hello World!
・Updated on ・1 min read

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 service with UI, API, Cache, Hits Counter and forwarder using postgres and redis in backend, bulma in frontend

urlsh

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.

It registers itself as Go module github.com/adhocore/urlsh (however it has not been submitted to Go package registry for public usage).

URLSH

Usage

Just visit urlssh.xyz. You can also integrate API for programmatic usage Read below for self hosting, API integration and/or contributing to urlsh.


Getting source

git clone git@github.com:adhocore/urlsh.git
cd urlsh
Enter fullscreen mode Exit fullscreen mode

Configuring

It should be configured using env variables.

Please check .env.example for available variables and explanation.

DATABASE_URL is always required and is string of the following form:

DATABASE_URL=postgres://user:pass@host:port/dbname

When running urlsh with docker-compose, the preferred way, DATABASE_URL is automatically set from POSTGRES_* variables.

Please note that urlsh does not ship with .env loader so to run it in bare metal one needs to use export KEY=VALUE or source .env manually.

…

Discussion (0)

Forem Open with the Forem app