Skip to content

Evgeniy-Golodnykh/urlcut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URLCut

Description

This is a URL-shortener service written on Python with Flask framework

Quick Start

  1. Clone the repository
git clone git@github.com:Evgeniy-Golodnykh/urlcut.git
  1. Creates a virtual environment
python3 -m venv venv
  1. Activates the virtual environment
source venv/bin/activate
  1. Upgrade PIP and installs the requirements package into the virtual environment
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
  1. Configure the .env file like this
FLASK_APP=urlcut
DATABASE_URI=sqlite:///urlcut_db.sqlite3
SECRET_KEY=YOUR_SECRET_KEY
  1. To run the application use command
flask run

API

# Endpoint to retrieve the original URL
Method: GET
Endpoint: "{your_local_host}:5000/api/id/{custom_id}/"

# Endpoint to create a short link
Method: POST
Endpoint: "{your_local_host}:5000/api/id/"
Request: {
    "url": "string",         # required
    "custom_id": "string"    # not required
}

Technology

Python, Flask, SQLAlchemy

Author

Evgeniy Golodnykh

Releases

No releases published

Packages

No packages published