SnapLink is a lightweight and efficient URL shortener built with Flask and SQLite. It allows users to shorten long URLs into compact, easily shareable links.
- Simple API for shortening and retrieving URLs
- Unique short codes generated for each URL
- Lightweight SQLite database for quick storage and retrieval
- Error handling for missing or duplicate URLs
- Easy to deploy and run locally
- Python 3.x
- pip (Python package manager)
- Clone the repository:
git clone https://github.com/YOUR_USERNAME/snaplink.git cd snaplink - Install dependencies:
pip install -r requirements.txt
- Run the application:
python app.py
- The service will be available at:
http://localhost:5000
- Endpoint:
/shorten - Method:
POST - Request Body:
{ "url": "https://example.com" } - Response:
{ "short_url": "http://localhost:5000/abc123" }
- Endpoint:
/{short_code} - Method:
GET - Response:
{ "redirect_to": "https://example.com" }
This project is licensed under the MIT License.