Axione-IPE-Viewer/webapp/main.py

20 lines
580 B
Python
Raw Normal View History

from flask import Flask, request, render_template
app = Flask(__name__)
@app.route("/", methods=['GET'])
def getMap():
return render_template("map.html")
@app.route("/eligdata", methods=['GET'])
def getEligData():
args = request.args
if 'swx' in args and 'swy' in args and \
'nex' in args and 'ney' in args:
return { "buildings": [
{"x": args['swx'], "y":args['swy'], "label": "dummy elig val" },
{"x": args['nex'], "y":args['ney'], "label": "dummy elig val 2" }
]}
else:
return "Missing coordinates", 400