Skip to content

rijil-tr/shortly

Repository files navigation

Shortly

Go Report Card Issues Forks Stars

Shortly

Shortly is a simple URL shortener service written in Golang. More detailed step by step tutorial can be found here.

Our URL shortening system should meet the following requirements:


Functional

  • Given a URL, our service should generate a shorter and unique alias of it. This is called a short link.
  • When users access a short link, our service should redirect them to the original link.
  • Users should optionally be able to pick a custom short link for their URL.
  • Links will expire after a standard default timespan. Users should be able to specify the expiration time.

Non-Functional

  • The system should be highly available.
  • URL redirection should happen in real-time with minimal latency.
  • Shortened links should not be guessable.

Running Shortly

go run cmd/main.go

Testing using cURL

Generate a short URL curl 'http://localhost:8080/' -H 'Content-Type: application/x-www-form-urlencoded' --data 'link=https://google.com'

Redirect curl http://localhost:8080/l/3E84B09B18848F91

Visitor Count curl http://localhost:8080/s/3E84B09B18848F91

About

Simple URL shortener written in Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published