Merge branch 'Testing-json' of https://github.com/d3m1g0d/TeraHz into Testing-json

This commit is contained in:
d3m1g0d
2019-03-26 19:06:42 +01:00

View File

@@ -1,5 +1,6 @@
from flask import Flask, redirect, url_for, request, render_template from flask import Flask, redirect, url_for, request, render_template
app = Flask(__Name__) app = Flask(__Name__)
URL = "" #Insert url of website here
@app.route('/list') @app.route('/list')
def list(): def list():
@@ -13,9 +14,12 @@ def load():
def deposit(): def deposit():
#Request .json, store json #Request .json, store json
if request.isJson(): if request.isJson():
request.json. content = request.get_json(url = URL)
return content
@app.route('/post', , methods = ['POST']):
def post():
request.post(url = URL, data = "") #Insert the data you wish to upload
@app.route('/graph') @app.route('/graph')
def graph(chartID = 'chart_ID', chart_type = 'line', chart_height = 500): def graph(chartID = 'chart_ID', chart_type = 'line', chart_height = 500):
@@ -27,4 +31,4 @@ def graph(chartID = 'chart_ID', chart_type = 'line', chart_height = 500):
return render_template('index.html', chartID=chartID, chart=chart, series=series, title=title, xAxis=xAxis, yAxis=yAxis) return render_template('index.html', chartID=chartID, chart=chart, series=series, title=title, xAxis=xAxis, yAxis=yAxis)
if __name__ == "__main__": if __name__ == "__main__":
app.run(debug = True, host='0.0.0.0', port=8080, passthrough_errors=True) app.run(debug = True, host='0.0.0.0', port=8080, passthrough_errors=True)