temp-api Code
Brought to you by:
lonsty
A flask api app for temperature platform based on flask-restful.
$ git clone http://10.161.32.68/F1054460/temp-api.git
$ cd temp-api/
$ pipenv install
$ pipenv shell
$ export FLASK_CONFIG=development
$ flask run -h 0.0.0.0 -p 5000 --reload
⚠️ Before deployment, confirm the configuration for different campuses. To switch campus, just edit CAMPUS_ID
in file config.py, available parameters:
1
: Longhua2
: Wuhan3
: Chongqing4
: Huasheng5
: Mexico6
: Malaysia$ sudo chmod +x scripts/deploy.sh
$ ./scripts/deploy.sh
$ docker build -t temp-api:latest -f Dockerfile .
$ docker save -o temp-api_latest.tar.gz
$ rsync temp-api_latest.tar.gz USER@HOST:PORT:/PATH/TO/DIR
$ ssh USER@HOST:PORT
$ docker load -i /PATH/TO/DIR/temp-api_latest.tar.gz
$ docker run -d -p 5857:5000 --env FLASK_CONFIG=production --restart always --name temp-api temp-api:latest
tests/temp-api_test-cases-for-Longhua.postman_collection.json