pykara commited on
Commit
ce042c9
Β·
1 Parent(s): 195fc50
Files changed (1) hide show
  1. app.py +30 -13
app.py CHANGED
@@ -22,6 +22,10 @@ def create_app():
22
  app = Flask(__name__)
23
  CORS(app, resources={r"/*": {"origins": "*"}})
24
 
 
 
 
 
25
  # --------------------------
26
  # Request logging
27
  # --------------------------
@@ -53,26 +57,39 @@ def create_app():
53
  # Blueprint registration
54
  # --------------------------
55
  try:
56
- from routes.auth_routes import auth_bp
57
- from routes.profile_routes import profiles_bp
58
- from routes.expectation_routes import expectations_bp
59
- from routes.matching_routes import matching_bp
60
- from routes.llm_routes import llm_bp
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
- # Attach blueprints
63
- app.register_blueprint(auth_bp, url_prefix="/api")
64
- app.register_blueprint(profiles_bp) # routes already start with /api/...
65
- app.register_blueprint(expectations_bp) # routes already start with /api/...
66
- app.register_blueprint(matching_bp, url_prefix="/api") # => /api/match, /api/match/<user_id>
67
- app.register_blueprint(llm_bp) # /llm/start, /llm/next
68
 
69
- print("βœ… DEBUG: All blueprints registered (auth, profiles, expectations, matching, llm)")
70
 
71
  except Exception as e:
72
  print("❌ DEBUG: Failed to import/register blueprints:", e)
73
  import traceback
74
  traceback.print_exc()
75
- # IMPORTANT: do NOT call safe_register or anything else here
 
76
 
77
  # --------------------------
78
  # Debug route to list all registered routes
 
22
  app = Flask(__name__)
23
  CORS(app, resources={r"/*": {"origins": "*"}})
24
 
25
+ print("πŸš€ DEBUG: Starting app creation...")
26
+ print(f"πŸš€ DEBUG: SQL_SERVER = {SQL_SERVER}")
27
+ print(f"πŸš€ DEBUG: SQL_DB = {SQL_DB}")
28
+
29
  # --------------------------
30
  # Request logging
31
  # --------------------------
 
57
  # Blueprint registration
58
  # --------------------------
59
  try:
60
+ # Use the routes package that already exposes all blueprints
61
+ import routes
62
+
63
+ print("βœ… DEBUG: Imported routes package")
64
+
65
+ # Auth under /api -> /api/signup, /api/login, ...
66
+ app.register_blueprint(routes.auth_bp, url_prefix="/api")
67
+ print("βœ… DEBUG: Registered auth_bp with prefix /api")
68
+
69
+ # Profile routes already have /api/... in their route paths
70
+ app.register_blueprint(routes.profiles_bp)
71
+ print("βœ… DEBUG: Registered profiles_bp (no prefix)")
72
+
73
+ # Expectation routes already have /api/... in their route paths
74
+ app.register_blueprint(routes.expectations_bp)
75
+ print("βœ… DEBUG: Registered expectations_bp (no prefix)")
76
+
77
+ # Matching under /api -> /api/match and /api/match/<user_id>
78
+ app.register_blueprint(routes.matching_bp, url_prefix="/api")
79
+ print("βœ… DEBUG: Registered matching_bp with prefix /api")
80
 
81
+ # LLM routes (e.g. /llm/start, /llm/next)
82
+ app.register_blueprint(routes.llm_bp)
83
+ print("βœ… DEBUG: Registered llm_bp (no prefix)")
 
 
 
84
 
85
+ print("βœ… DEBUG: All blueprints registered successfully")
86
 
87
  except Exception as e:
88
  print("❌ DEBUG: Failed to import/register blueprints:", e)
89
  import traceback
90
  traceback.print_exc()
91
+ # Important: re-raise so the app does NOT start silently without routes
92
+ raise
93
 
94
  # --------------------------
95
  # Debug route to list all registered routes