Update app.py
Browse files
app.py
CHANGED
@@ -29,21 +29,12 @@ try:
|
|
29 |
except Exception as e:
|
30 |
print(f"β Failed to connect to Salesforce: {str(e)}")
|
31 |
|
32 |
-
# β
|
33 |
-
@app.before_request
|
34 |
-
def print_routes():
|
35 |
-
if not hasattr(app, 'printed_routes'):
|
36 |
-
app.printed_routes = True
|
37 |
-
print("\nβ
Available Routes:")
|
38 |
-
for rule in app.url_map.iter_rules():
|
39 |
-
print(f"β‘ {rule}")
|
40 |
-
|
41 |
-
# β
HOME ROUTE (Now Renders `index.html`)
|
42 |
@app.route("/", methods=["GET"])
|
43 |
def home():
|
44 |
return render_template("index.html")
|
45 |
|
46 |
-
# β
RENDER DASHBOARD
|
47 |
@app.route("/dashboard", methods=["GET"])
|
48 |
def dashboard():
|
49 |
return render_template("dashboard.html")
|
@@ -69,7 +60,7 @@ def register():
|
|
69 |
})
|
70 |
return jsonify({"success": True, "message": "Registration successful", "customer_id": new_customer["id"]})
|
71 |
except Exception as e:
|
72 |
-
return jsonify({"error": f"
|
73 |
|
74 |
# β
LOGIN API: Validate User Credentials
|
75 |
@app.route("/login", methods=["POST"])
|
|
|
29 |
except Exception as e:
|
30 |
print(f"β Failed to connect to Salesforce: {str(e)}")
|
31 |
|
32 |
+
# β
HOME ROUTE (Simplified - Renders index.html)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
@app.route("/", methods=["GET"])
|
34 |
def home():
|
35 |
return render_template("index.html")
|
36 |
|
37 |
+
# β
RENDER DASHBOARD PAGE
|
38 |
@app.route("/dashboard", methods=["GET"])
|
39 |
def dashboard():
|
40 |
return render_template("dashboard.html")
|
|
|
60 |
})
|
61 |
return jsonify({"success": True, "message": "Registration successful", "customer_id": new_customer["id"]})
|
62 |
except Exception as e:
|
63 |
+
return jsonify({"error": f"Registration failed: {str(e)}"}), 500
|
64 |
|
65 |
# β
LOGIN API: Validate User Credentials
|
66 |
@app.route("/login", methods=["POST"])
|