Update app.py
Browse files
app.py
CHANGED
@@ -13,22 +13,13 @@ SF_DOMAIN = "login" # Use "test" if using a sandbox
|
|
13 |
# Connect to Salesforce
|
14 |
sf = Salesforce(username=SF_USERNAME, password=SF_PASSWORD, security_token=SF_SECURITY_TOKEN, domain=SF_DOMAIN)
|
15 |
|
|
|
|
|
|
|
|
|
16 |
@app.route('/get_menu', methods=['GET'])
|
17 |
def get_menu():
|
18 |
-
|
19 |
-
menu_items = sf.query(query)['records']
|
20 |
-
|
21 |
-
menu_data = [
|
22 |
-
{
|
23 |
-
"name": item["Name"],
|
24 |
-
"price": item["Price__c"],
|
25 |
-
"description": item.get("Description__c", ""),
|
26 |
-
"image": item.get("Image1__c", "")
|
27 |
-
}
|
28 |
-
for item in menu_items
|
29 |
-
]
|
30 |
-
|
31 |
-
return jsonify(menu_data)
|
32 |
|
33 |
if __name__ == "__main__":
|
34 |
-
app.run(host="0.0.0.0", port=7860, debug=True
|
|
|
13 |
# Connect to Salesforce
|
14 |
sf = Salesforce(username=SF_USERNAME, password=SF_PASSWORD, security_token=SF_SECURITY_TOKEN, domain=SF_DOMAIN)
|
15 |
|
16 |
+
from flask import Flask, jsonify
|
17 |
+
|
18 |
+
app = Flask(__name__)
|
19 |
+
|
20 |
@app.route('/get_menu', methods=['GET'])
|
21 |
def get_menu():
|
22 |
+
return jsonify({"message": "Menu endpoint is working!"})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
if __name__ == "__main__":
|
25 |
+
app.run(host="0.0.0.0", port=7860, debug=True)
|