https://github.com/regshift/url-shortner
This is a URL shortner which uses one of the fastest go framework fiber along with one of the fastest in memory database redis
https://github.com/regshift/url-shortner
fiber golang redis
Last synced: 7 months ago
JSON representation
This is a URL shortner which uses one of the fastest go framework fiber along with one of the fastest in memory database redis
- Host: GitHub
- URL: https://github.com/regshift/url-shortner
- Owner: regshift
- Created: 2023-11-09T04:28:46.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-11T05:15:47.000Z (over 2 years ago)
- Last Synced: 2025-07-13T09:05:15.924Z (10 months ago)
- Topics: fiber, golang, redis
- Language: Go
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lightning-Fast URL Shortener with Golang Fiber and Redis
A high-performance URL shortener built with Golang using the Fiber web framework and Redis as the database.
## Features
- Lightning-fast URL shortening.
- Utilizes the Golang Fiber framework for efficient handling.
- Uses Redis for quick and reliable storage.
## Getting Started
### Prerequisites
- Golang: [Install Golang](https://golang.org/doc/install)
- Redis: [Install Redis](https://redis.io/download)
### Installation
1. Clone the repository:
```bash
git clone https://github.com/yourusername/lightning-fast-url-shortener.git
```
2. Change into the project directory:
```bash
cd lightning-fast-url-shortener
```
3. Build and run the project:
```bash
go build
./url-shortener
```
## API Endpoint
### Shorten URL
- **URL:** `POST /`
- **Request:**
- **Method:** `POST`
- **Endpoint:** `/`
- **Request Body:**
```json
{
"url": "https://www.yourdomain.com"
}
```
- **Response (Success):**
- **Status Code:** `200 OK`
- **Response Body:**
```json
{
"shorted_url": "http://localhost:3000/s/abc123",
"error": ""
}
```
- **Response (Error):**
- **Status Code:** `400 Bad Request`
- **Response Body:**
```json
{
"shorted_url": "",
"error": "Invalid URL"
}
```