- Memcached/redis caching
- Rate limit
- Simple webui
- Distribute Database
- Logging and debuging
- Performance test
- custom URL(optional)
- OS: *(default for linux)
- python: 2.7.* (If all the dependencies are working well with py3, should upgrade to 3)
- flask: 0.10.*
- db: mysql/mariadb
- Create DB and DB user
DB:
name:devdb
user:tiny_url
passwd:tiny1234
- Or running db setup scirpts:
mysql -uroot -ppasswd < create_user_dev.sql
mysql -uroot -ppasswd < init_db.sql
- Install dependencies
# mysql client
sudo apt-get install libmysqlclient-dev # mysql
sudo apt-get install libmariadbclient-dev # mariaDB
# python-dev
sudo apt-get install python-dev # ubuntu
sudo zypper install python-devel # opensuse
- Install flask
# install pip
# install virtualenv
pip install -r requirements.txt
- Start
python app.py
- With cURL:
# visit:
curl localhost:5000
# generate short url:
curl --form "origin_url='haoc.io'" localhost:5000/g
# visit short url:
curl "localhost:5000/v/******
Forget TDD :)
The only piece of code coverd by tests is urlconverter.py
python -m tests.urlconverter-test