From faa13839f898c60ff5618be6e916ad2e60958468 Mon Sep 17 00:00:00 2001 From: nil0j Date: Sat, 21 Sep 2024 10:17:23 +0200 Subject: init --- python/routes.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 python/routes.py (limited to 'python/routes.py') diff --git a/python/routes.py b/python/routes.py new file mode 100644 index 0000000..a60584d --- /dev/null +++ b/python/routes.py @@ -0,0 +1,24 @@ +from flask import Flask, jsonify, request +import database + + +def createApp(): + return Flask(__name__) + + +def createRoutes(app, connector): + @app.route("/", methods=['GET']) + def hello_world(): + arg1 = request.args.get('arg1') + arg2 = request.args.get('arg2') + return jsonify({'arg1': arg1, + 'arg2': arg2}) + + @app.route("/db", methods=['GET']) + def database_hello(): + return jsonify( + database.runQuery( + connector, + "SHOW DATABASES" + ) + ) -- cgit v1.2.3