From 6d1377d623638c2483c0bb2df49070e822151ce6 Mon Sep 17 00:00:00 2001 From: kaiyuran <73236245+kaiyuran@users.noreply.github.com> Date: Wed, 20 Nov 2024 13:03:49 -0500 Subject: [PATCH] update server ports commented out port is to run on nest server --- app.py | 49 +++++++++++++++++++++++++++++++++++++++++++------ testGet.py | 4 ++-- 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/app.py b/app.py index 74b0a03..ed0e10c 100644 --- a/app.py +++ b/app.py @@ -175,6 +175,39 @@ def emojify(message): "fruit": "🍉", "refreshing": "🍉", "summer": "🍉", + + + + "eggplant": "🍆", + "aubergine": "🍆", + "banana": "🍌", + "peach": "🍑", + "cherries": "🍒", + "strawberry": "🍓", + "tomato": "🍅", + "avocado": "🥑", + "broccoli": "🥦", + "carrot": "🥕", + "corn": "🌽", + "cucumber": "🥒", + "lettuce": "🥬", + "mushroom": "🍄", + "pepper": "🌶️", + "hotpepper": "🌶️", + "potato": "🥔", + "sweetpotato": "🍠", + "croissant": "🥐", + "baguette": "🥖", + "pretzel": "🥨", + "cheese": "🧀", + "egg": "🥚", + "bacon": "🥓", + "pancakes": "🥞", + "poultryleg": "🍗", + "chicken": "🍗", + "meat": "🍖", + "bacon": "🥓", + } message = message.strip('"') @@ -201,19 +234,21 @@ def emojify(message): - - - app = Flask(__name__) -CORS(app) +CORS(app) + +#if __name__ == "__main__": +# app.run(host='0.0.0.0', port=33303) + @app.route('/getemoji', methods=['GET']) +# @cross_origin() def get_random_emoji(): # Get the 'letter' parameter from the URL message = request.args.get('message') print(message) - + final = emojify(message) # print(final) final = jsonify({"message": final})# emoji in JSON format @@ -222,4 +257,6 @@ def get_random_emoji(): return final if __name__ == '__main__': - app.run(debug=True) \ No newline at end of file + #app.run(debug=True) + app.run(port=33303) + # app.run(host='0.0.0.0', port=33303) \ No newline at end of file diff --git a/testGet.py b/testGet.py index 53c168f..5647325 100644 --- a/testGet.py +++ b/testGet.py @@ -1,7 +1,7 @@ import requests -url = "http://127.0.0.1:5000/getemoji" - +# url = "http://127.0.0.1:5501/getemoji" +url = "http://37.27.51.34:33303/getemoji" params = { "message": "I love chocolate donuts. I laugh at funny jokes about it. I think it is amazing." }