diff options
Diffstat (limited to 'python/routes.py')
-rw-r--r-- | python/routes.py | 24 |
1 files changed, 24 insertions, 0 deletions
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" + ) + ) |