https://github.com/kryptonbd/go-choto-link
URL shortener built in Go
https://github.com/kryptonbd/go-choto-link
go golang url-shortener
Last synced: 3 months ago
JSON representation
URL shortener built in Go
- Host: GitHub
- URL: https://github.com/kryptonbd/go-choto-link
- Owner: KryptonBD
- Created: 2025-03-13T12:20:34.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-03-13T12:20:51.000Z (10 months ago)
- Last Synced: 2025-09-09T04:44:11.181Z (4 months ago)
- Topics: go, golang, url-shortener
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Choto-Link
Choto-Link is a URL shortening service built with Go and Redis. It provides a RESTful API for creating, managing, and accessing shortened URLs with features like rate limiting and custom short URLs.
## Features
- URL shortening with auto-generated or custom short URLs
- Configurable URL expiration (default 24 hours)
- Rate limiting to prevent abuse
- RESTful API for CRUD operations
- Redis-based storage for high performance
- Docker support for easy deployment
## Prerequisites
- Go
- Docker and Docker Compose (for containerized deployment)
## Installation
1. Clone the repository
2. Rename the `.env.example` file to `.env` and update with your credentials
3. Build and run using Docker Compose:
```bash
docker-compose up --build
```
The service will be available at `http://localhost:8080`
## API Endpoints
### Create Short URL
```http
POST /api/shorten
```
Request body:
```json
{
"url": "https://example.com/very-long-url",
"custom_short": "custom123", // optional
"expiry": 3600 // optional, in seconds
}
```
### Get Original URL
```http
GET /api/shorten/:shortUrl
```
### Update Short URL
```http
PUT /api/shorten/:shortUrl
```
Request body:
```json
{
"url": "https://example.com/new-url"
}
```
### Delete Short URL
```http
DELETE /api/shorten/:shortUrl
```
### Redirect to Original URL
```http
GET /:shortUrl
```
## FAQ
#### What is Choto?
Choto is a Bengali word that means "small" or "short". It's a common term used in Bangladesh to refer to something that is small in size or duration.