File size: 636 Bytes
aeea182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b45a0d5
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from flask import Flask, request, jsonify
from flask_cors import CORS

app = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "*"}})

# Static reply for testing
@app.route("/get_response", methods=["POST"])
def get_response():
    # Get the message from the frontend (though we're ignoring it)
    data = request.get_json()
    message = data.get("message")  # You can use this if you want to log the message or process it
    # Static response message
    response = {"response": "This is a static reply for testing."}
    return jsonify(response)

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=7860, debug=True)