-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdebug_routes.py
More file actions
52 lines (40 loc) Β· 1.5 KB
/
Copy pathdebug_routes.py
File metadata and controls
52 lines (40 loc) Β· 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env python3
"""Debug script to check registered Flask routes"""
import sys
from pathlib import Path
# Add current directory to Python path
ROOT = Path(__file__).resolve().parent
sys.path.insert(0, str(ROOT))
from windows_robot_supervisor import WindowsRobotSupervisor
def debug_routes():
print("π Checking registered Flask routes...")
print("=" * 50)
supervisor = WindowsRobotSupervisor()
print("π Registered routes:")
for rule in supervisor.app.url_map.iter_rules():
methods = ', '.join(rule.methods - {'HEAD', 'OPTIONS'})
print(f" {rule.rule:<40} [{methods}]")
print()
print("π― Looking for audio-chat route:")
audio_routes = [rule for rule in supervisor.app.url_map.iter_rules()
if 'audio-chat' in rule.rule]
if audio_routes:
for route in audio_routes:
print(f" β
Found: {route.rule} {route.methods}")
else:
print(" β No audio-chat route found!")
print()
print("π§ͺ Testing route resolution:")
test_paths = [
"/api/assistant/audio-chat",
"/api/assistant/message",
"/api/assistant/reminders"
]
for path in test_paths:
try:
endpoint, values = supervisor.app.url_map.bind('localhost').match(path, 'POST')
print(f" β
{path:<35} -> {endpoint}")
except Exception as e:
print(f" β {path:<35} -> {type(e).__name__}: {e}")
if __name__ == "__main__":
debug_routes()