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.
- Clone the repository
$ git clone https://github.com/sarkartanmay393/URL-Shortener-Go.git
- Run
docker compose up
in the root directory
$ docker compose up
- 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.
- 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
}
- You can use the
short
URL to redirect to the original URL.
- Fork the repository
- Clone the repository
git clone https://github.com/sarkartanmay393/URL-Shortener-Go.git
- Create a new branch
git checkout -b <branch-name>
- Make changes and commit
git add . && git commit -s -m "New feature added"
- Push the changes
git push origin <branch-name>
- Create a pull request and wait for it to be merged 🎉