Skip to content

myfashionhub/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener

Specs

  • Using Python2, Flask

Setting up

  • Install requirements: pip install -r requirements.txt

  • Run the app: python run.py

  • Application is available at localhost:5000

  • If you run into module import error, you can try running the app in virtualenv:

$ pip install virtualenv
$ virtualenv url_shortener
$ . url_shortener/bin/activate
$ pip install -r requirements.txt
$ python run.py
$ deactivate      # Exit virtualenv
  • The home page has a form that allows you to input target URLs and create short links. If the target URL is valid, a short URL is created, user is redirected to the edit page.

  • On the edit page, user can add target URL to the current short link based on the device type (based on Werkzeug's doc on platform types).

  • Clicking on the short URL on a desktop environment short increase the number of clicks under that target on refresh. The first target added is the default for types of device that don't have specified target.

  • I tested on mobile devices by using the public IP instead of localhost. The number of clicks increased for the mobile target.

  • "All my links" page has a list of all the short links created

Testing

(The config setup is not perfect since I am new to Flask)

  • Change TEST_MODE to True in url_shortener/config.py
  • Run the test suite py.test url_shortener/tests

About

Generate short URLs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published