An open API service indexing awesome lists of open source software.

https://github.com/codetoby/url-shortener

Short URL
https://github.com/codetoby/url-shortener

Last synced: 11 months ago
JSON representation

Short URL

Awesome Lists containing this project

README

          

# URL Shortener

A simple and efficient URL shortener service that allows users to convert long URLs into short and shareable links.

## API Endpoints

- **Shorten a URL**:
- **Endpoint**: `POST /`
- **Body**: `{ "url": "YOUR_LONG_URL_HERE" }`
- **Response**: `{ "id": "SHORT_ID" }`

- **Redirect to Original URL**:
- **Endpoint**: `GET /:shortId`
- **Response**: Redirects to the original long URL.

**Database Configuration**:
- Create a `.env` file in the root directory.
- Configure the database settings in the `.env` file. Example: `.env.example`

**Run**:
- Make sure to have docker installed
- ```docker-compose up```