Skip to content

Contains go code with docker files to serve us a url shortener service.

Notifications You must be signed in to change notification settings

sarkartanmay393/URL-Shortener-Go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener Service 🩳

Built using Golang, Redis, Docker, Docker Compose.

Description 📝

This is a simple URL shortener service that uses Redis as a database. It is built using Golang and Docker. It is also deployed on somewhere.

How to run 🏃‍♂️

  1. Clone the repository
$ git clone https://github.com/sarkartanmay393/URL-Shortener-Go.git
  1. Run docker compose up in the root directory
$ docker compose up

How to use 🤔

  1. Send a POST request to localhost:3000/api/v1 with the following raw body
{
    "url": "www.tanmaysarkar.tech"
}

You may have to set Content-Type to application/json in the header.

  1. You will get a response like this
{
  "url": "http://tanmaysarkar.tech",
  "short": "localhost:3000/abcde1234",
  "expiry": 24,
  "x-rate-remaining": 96,
  "x-rate-limit-reset": 28
}
  1. You can use the short URL to redirect to the original URL.

Test Screenshots 📸

URL Shortening without custom id
URL Shortening with custom id

How to Contribute 🤝

  1. Fork the repository
  2. Clone the repository
git clone https://github.com/sarkartanmay393/URL-Shortener-Go.git
  1. Create a new branch
git checkout -b <branch-name>
  1. Make changes and commit
git add . && git commit -s -m "New feature added"
  1. Push the changes
git push origin <branch-name>
  1. Create a pull request and wait for it to be merged 🎉

Connect with me 🖇️

· Twitter/sarkartanmay393 🐦

About

Contains go code with docker files to serve us a url shortener service.

Topics

Resources

Stars

Watchers

Forks