Skip to content

hitnik/url_shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL shortener APP

URL shortener is cli application for generate,save and get from database short urls.

Features

  • Generating a short link from a long link.
  • Save you cuctom long and short links, then het long link from short

Installation

Clone git repository https://github.com/hitnik/url_shortener.git

git clone https://github.com/hitnik/url_shortener.git .
cd url_shortener

Install Python dependencies

python3 -m pip install -r requirements.txt

 

cli application interface

 

Getting help

python main.py -h

Application use

To generate short url from long

python main.py <long url> --generate

To save long and short urls

python main.py <long url>  --generate --short_url <short url>

To get short url from long url

python main.py <short url>

 

application web interface (version > 2.0)

 

export FLASK_APP=main
export SECRET_KEY=<your_secret>
flask init-db
flask run --port=80

 

Access application at http://localhost