A high-performance URL shortener built with Golang using the Fiber web framework and Redis as the database.
- Lightning-fast URL shortening.
- Utilizes the Golang Fiber framework for efficient handling.
- Uses Redis for quick and reliable storage.
- Golang: Install Golang
- Redis: Install Redis
-
Clone the repository:
git clone https://github.com/yourusername/lightning-fast-url-shortener.git
-
Change into the project directory:
cd lightning-fast-url-shortener
-
Build and run the project:
go build ./url-shortener
- URL:
POST /
- Request:
- Method:
POST
- Endpoint:
/
- Request Body:
{ "url": "https://www.yourdomain.com" }
- Method:
- Response (Success):
- Status Code:
200 OK
- Response Body:
{ "shorted_url": "http://localhost:3000/s/abc123", "error": "" }
- Status Code:
- Response (Error):
- Status Code:
400 Bad Request
- Response Body:
{ "shorted_url": "", "error": "Invalid URL" }
- Status Code: