mini-project / app.py
Rohit Ghosh
something
b45a0d5
raw
history blame contribute delete
636 Bytes
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)