-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_web_ui.py
More file actions
38 lines (33 loc) · 966 Bytes
/
run_web_ui.py
File metadata and controls
38 lines (33 loc) · 966 Bytes
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
#!/usr/bin/env python3
"""
Startup script for the TestFoundry Web UI
"""
import sys
import uvicorn
from pathlib import Path
# Add the web_ui directory to Python path
web_ui_path = Path(__file__).parent / "web_ui"
sys.path.insert(0, str(web_ui_path))
def main():
"""Run the FastAPI web server"""
print("Starting TestFoundry Web UI...")
print("Server will be available at: http://localhost:8000")
print("API docs available at: http://localhost:8000/docs")
print("Press Ctrl+C to stop the server")
print("-" * 50)
try:
uvicorn.run(
"api.server:app",
host="0.0.0.0",
port=8000,
reload=True,
reload_dirs=[str(web_ui_path)],
log_level="info"
)
except KeyboardInterrupt:
print("\nServer stopped. Goodbye!")
except Exception as e:
print(f"Error starting server: {e}")
sys.exit(1)
if __name__ == "__main__":
main()