-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
43 lines (33 loc) · 788 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from flask import Flask, session, render_template, jsonify, request
app = Flask(__name__)
app.secret_key = "super secret key"
playNum = '0'
displayNum = '0'
@app.route('/')
def hello_world():
return render_template('index.html')
@app.route('/get')
def getting():
global playNum
return jsonify({
"id": playNum
})
@app.route('/getNumber')
def getting1():
global displayNum
return displayNum
@app.route('/putNumber/<id>')
def getting2(id):
global displayNum
displayNum = id
print(id)
return displayNum
@app.route('/submit')
def submit():
global playNum
playNum = request.args.get("id")
return jsonify({
"id": playNum
})
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8081, debug=True)