forked from amiv/bier-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
visualWeb.py
executable file
·47 lines (37 loc) · 983 Bytes
/
visualWeb.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
44
45
46
47
#!/usr/bin/env python
from flask import Flask, jsonify, render_template, request
import sys
app = Flask(__name__)
getBeer = 1
@app.route('/')
def index():
return 'Index Page'
@app.route('/beer/')
@app.route('/beer/<beer>')
def beer(beer=None):
return render_template('beer.html', beer=beer)
@app.route('/valid')
def valid():
return render_template('valid.html')
@app.route('/ajax')
def ajax():
return render_template('ajax.html')
@app.route('/hello')
def hello():
return render_template('hello.html')
@app.route('/_checkLegi', methods=['POST','GET'])
def checkLegi():
global getBeer
getBeer = request.args.get('getBeer', 0, type=int)
print >>sys.stderr,getBeer
return ""
@app.route('/_updateLegi')
def updateLegi():
global getBeer
if (getBeer > 0):
releaseBeer = getBeer
else:
releaseBeer = getBeer
return jsonify(result=releaseBeer)
if __name__ == '__main__':
app.run('127.0.0.1',debug=True)