add requirements and readme instructions

This commit is contained in:
Maxime Bloch 2019-09-20 14:55:11 +02:00
parent a1d438f04d
commit c66b256b54
No known key found for this signature in database
GPG key ID: CE32A7D95B7D6418
4 changed files with 41 additions and 4 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
__pycache__/ __pycache__/
venv/

35
README.md Normal file
View file

@ -0,0 +1,35 @@
# Rube Goldberg repo
## The server
The server is there to show the progress of a current run and all previous runs.
### Requirements
- python
- pip
### How do you run this?
Create a venv with the correct packages
python3 -m venv venv
Activate the virtual environment
source venv/bin/activate
Install the requirements
pip install -r requirements.txt
Start the server!
python app.py
Go enjoy the dashboard @localhost:5000
## The client
This is an example client and will also be used as first link in the machine.

View file

@ -30,8 +30,8 @@ def start_run(run_index):
return f'Run {run_index} started at {starttime}' return f'Run {run_index} started at {starttime}'
@app.route("/checkpoint/start/<run>/<index>") @app.route("/link/start/<run>/<index>")
def checkpoint_start(run, index): def link_start(run, index):
if db["current_run"] != run: if db["current_run"] != run:
return "Wrong run number, you are probably behind.", 404 return "Wrong run number, you are probably behind.", 404
else: else:
@ -39,8 +39,8 @@ def checkpoint_start(run, index):
return "Success." return "Success."
@app.route("/checkpoint/handoff/<run>/<index>") @app.route("/link/handoff/<run>/<index>")
def checkpoint_handoff(run, index): def link_handoff(run, index):
if db["current_run"] != run: if db["current_run"] != run:
return "Wrong run number, you are probably behind.", 404 return "Wrong run number, you are probably behind.", 404
else: else:

1
watcher/requirements.txt Normal file
View file

@ -0,0 +1 @@
flask