lokesh341 commited on
Commit
a40aeaa
Β·
verified Β·
1 Parent(s): 2cd82ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -12
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
- # βœ… Print All Available Routes at Startup
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"Failed to register: {str(e)}"}), 500
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"])