2022-02-21 17:21:21 +01:00
|
|
|
from flask import Flask, request, render_template
|
2022-02-21 15:28:19 +01:00
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
|
|
@app.route("/", methods=['GET'])
|
|
|
|
def getMap():
|
|
|
|
return render_template("map.html")
|
2022-02-21 17:21:21 +01:00
|
|
|
|
|
|
|
@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
|