blob: fa79216c4907f56e35dea8d07ea33fe2811b5125 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
from flask import Flask
from flask import render_template, request
from unipath import FSPath as Path
DATA_DIR = Path(__file__).absolute().child('data')
app = Flask(__name__)
@app.route('/')
def home():
return render_template('home.html')
@app.route('/data', methods=['POST', 'GET'])
def data():
if request.method == 'GET':
return 'hai'
elif request.method == 'POST':
print request.json
return 'ok'
if __name__ == '__main__':
app.run(debug=True)
|