Skip to content

Commit b77bc22

Browse files
committed
Add status page
1 parent c624e4d commit b77bc22

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

machine_controller/app.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,17 @@ def vend():
6565

6666
return jsonify(transaction_id=transaction_id, items=statuses)
6767

68+
@app.route('/status', methods=['GET'])
69+
def status():
70+
if request.headers.get('Authorization', '') != token_value:
71+
abort(401)
72+
73+
# 200 to indicate success
74+
return ('', 200)
75+
76+
77+
6878
if __name__ == '__main__':
6979
# Make sure flask runs in a single thread. Otherwise concurrent requests
7080
# may cause problems with vending
7181
app.run(debug=True, host='0.0.0.0', threaded=False)
72-

0 commit comments

Comments
 (0)