Go Url Shortener

An URL shortener written in Golang
Alternatives To Go Url Shortener
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Canoe29
5 years agoMay 31, 2021Go
Very simple URL shortener
Go Url Shortener27
7 years agoJune 02, 2021Go
An URL shortener written in Golang
Shortify4
7 years agoRuby
URL Shortener API assignment
Slugger4
3 years ago1PHP
🐌 The slugging library used by Darkshare to create incremental slugs.
Goshort3
a month agomitGo
Mirror
Shorty2
4 years agomitGo
A minimalist persisted URL shortener
Shmag2
3 years agomitTypeScript
Url Shortener API
Url Shortner2
23 days ago11Vue
Basic URL shortener with slugs and user authentication
Shore2
12 years agomitRuby
A private URL shortener with an API.
Shortener2
10 years agomitJavaScript
A url shortener backed by Redis 2.6.x (as it requires Lua script to function).
Alternatives To Go Url Shortener
Select To Compare


Alternative Project Comparisons
Readme

An URL shortener written in Golang

Inspired by Mathias Bynens' PHP URL Shortener, and triggered by a wish to learn Go, I wanted to try and see if I could build an URL shortener in Go.

Features

  • Redirect to your main website when no slug, or incorrect slug, is entered, e.g. http://wiere.ma/http://samwierema.nl/.
  • Generates short URLs using only [a-z0-9] characters.
  • 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.

Installation

  1. Download the source code and install it using the go install command.
  2. Use database.sql to create the redirect table in a database of choice.
  3. Create a config file in /path/to/.go-url-shortener/ named config.(json|yaml|toml). Use config-example.json as a example.
  4. Run the program as a daemon using one of the many methods: write a script for upstart, init, use daemonize, Supervisord, Circus or just plain old nohup. You can even start (and manage) it in a screen session.
  5. Adding the following configuration to Apache (make sure you've got mod_proxy enabled):
<VirtualHost *:80>
	ServerName your-short-domain.ext

	ProxyPreserveHost on
	ProxyPass / http://localhost:8080/
	ProxyPassReverse / http://localhost:8080/
</VirtualHost>

Using the example init script

You will find an example init script in the scripts folder. To use, you must at least change the GOPATH line to point to your Go root path.

To-do

  • Add tests

Author

Popular Url Shortener Projects
Popular Slug Projects
Popular Applications Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Go
Golang
Slug
Url Shortener