Skip to content
URL shortener written in Golang
Branch: master
Clone or download
Latest commit 3b76162 Mar 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore finished Mar 22, 2019
LICENSE Initial commit Mar 22, 2019
README.md Update README.md Mar 23, 2019
redirects.json.example finished Mar 22, 2019
shortener.go rename file Mar 22, 2019

README.md

url-shortener-go

This is a simple URL shortener written in Go. It is one of my first projects written in Golang.

I included an example redirects file called redirects.json.example. Just rename that to redirects.json and change the redirects however you want. I also included code comments for readers to know what the code does.

To build the project simply run go build shortener.go

  • Default port is 3000. To change the port pass a PORT environment variable.
  • The "/" redirect is the fallback and will be used in the event of any unknown URL. For example, if I go to /lalalejfiodkjcjduisk and it is not in the redirects.json, I will be redirected to whatever the "/" is set to.

Star this repo

You can’t perform that action at this time.