A simple URL shortener service implemented using Go programming language and Redis as the backend data store. This project aims to provide a minimalistic and efficient solution for shortening long URLs and redirecting users to the original URLs.
- Shorten long URLs to a compact format.
- Redirect users from the short URL to the original URL.
- Utilizes Redis for fast and reliable data storage.
- Have RateLimiting which means that you cannot hit the endpoint after some ITERATION (API_QUOTA)
These instructions will help you set up the project and get it running on your local machine for development and testing purposes.
To run this project, you need to have the following tools installed on your system:
- Go (at least Go 1.11)
- Redis
-
Clone the repository
git clone https://github.com/jiteshchawla1511/url-shortener.git
-
Navigate to the project directory:
cd url-shortner
-
Install the project dependencies
go mod download
- Start the Redis Server
redis-server
- Run the main file
go run main.go
- Now send/POST the JSON OBJECT TO URL http://localhost:3000/api/v1
{ "url" : "{url Link}" } Example { "url" : "https://www.youtube.com/watch?v=dQw4w9WgXcQ" }
-
DB_ADDR="localhost:6379"
-
DB_PASS=""
-
APP_PORT=":3000"
-
DOMAIN="localhost:3000"
-
API_QUOTA=10