From 82c41dadc81d91b309618a33609b7b64b646b9fa Mon Sep 17 00:00:00 2001 From: Angelos <36424692+SEO-Warlord@users.noreply.github.com> Date: Mon, 24 Apr 2023 15:52:34 +1000 Subject: [PATCH] Just testing testing --- app.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index d82c51f0d..b8abd0023 100644 --- a/app.py +++ b/app.py @@ -1,6 +1,13 @@ -from flask import Flask +from flask import Flask, request, jsonify +from autosuggest import get_autosuggest + app = Flask(__name__) -@app.route('/') -def hello_world(): - return 'Hello, World!' +@app.route('/get_autosuggest', methods=['GET']) +def autosuggest(): + query = request.args.get('query') + suggestions = get_autosuggest(query) + return jsonify(suggestions=suggestions) + +if __name__ == '__main__': + app.run()