Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 881 Bytes

README.md

File metadata and controls

23 lines (18 loc) · 881 Bytes

An URL shortener written in Golang

I wanted to try and see if I could build an URL shortener in Go.

Features

  • Doesn’t create multiple short URLs when you try to shorten the same URL. In this case, the script will simply return the existing short URL for that long URL.
  • Redirect to your main website when no shortid, or incorrect shortid, is entered, e.g. http://localhost:8080/xdfhttp://localhost:8080/.
  • Generates short URLs using only [a-z0-9] characters.

Installation

  1. Download the source code and install it using the go install command.
  2. Use database.sql to create the tiny_urls table.
  3. Create a config file in /path/to/url-shortener/ named config.(json|yaml|toml). Use config-example.json as a example.
docker-compose build
docker-compose up

To-do

  • Add tests
    • Build Docker image for kuberntes.
  • Add deployment