I create a project to show how to program with flask.
pip install -r requirements.txt
Referrence to script.
Referrence to script.
- Formal Environment
$ ./start_rest.sh # 启动rest服务
#!/usr/bin/env bash
export FLASK_COMMON_CONF=~/python/ProofOfReserves/config/production.py
export FLASK_INSTANCE_CONF=~/python/ProofOfReserves/instance/production.py
# python app.py
gunicorn -w 1 -b 127.0.0.1:6000 app:app --daemon
- Test Environment
$ ./t_start_rest.sh
$ ./t_start_cron.sh
Configuration
sudo apt install nginx
sudo vim /etc/nginx/sites-enabled/default
sudo systemctl restart nginx
curl http://127.0.0.1:6000/asset/btc/statistic
curl http://127.0.0.1:6000/asset/btc/reserve
curl http://127.0.0.1:6000/user/12560005/asset/btc/validation
curl http://127.0.0.1:6000/user/12560005/asset/btc/validation?mark=0
curl http://127.0.0.1:6000/user/12560005/asset/btc/validation?mark=1
curl http://127.0.0.1:6000/user/12560005/asset/btc/isvalidated
curl http://127.0.0.1:6000/asset/btc/count
curl http://127.0.0.1:6000/count
curl http://127.0.0.1:6000/asset/btc/merkleroot
curl http://127.0.0.1:6000/asset/btc/merkle
curl http://127.0.0.1:6000/asset