mirror of
https://github.com/uw935/vatsimfox.git
synced 2026-09-17 09:29:00 +00:00
switch to new python version && minor bugs fixed
This commit is contained in:
+4
-6
@@ -1,5 +1,5 @@
|
||||
from flask import Flask, render_template, abort, request, jsonify
|
||||
import requests
|
||||
from flask import Flask, render_template, abort, request, jsonify
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
@@ -15,14 +15,12 @@ def index_page():
|
||||
def errorhandler_page(_):
|
||||
return render_template("4O4.html"), 404
|
||||
|
||||
# Custom wrapper to fetch VATSIM data
|
||||
|
||||
@app.route("/api/request")
|
||||
def request_handler():
|
||||
request_string = request.args.get("request_string")
|
||||
|
||||
if request_string:
|
||||
if request_string := request.args.get("request_string"):
|
||||
return requests.get(f"{VATSIM_API_URL}{request_string}").json()
|
||||
|
||||
|
||||
return jsonify({"result": "not found"})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user