Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion backend/app/utils/microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,28 @@ def _start_fastapi_service(python_executable: Path, service_path: Path) -> bool:

# Command to start FastAPI dev server
print(python_executable)
cmd = [str(python_executable), "-m", "fastapi", "dev", "--port", "8001"]
host = "127.0.0.1"
port = "8001"
# On Windows, use a different approach with scripts path

if platform.system().lower() == "windows":
# Use uvicorn directly to run the FastAPI app
cmd = [
str(python_executable),
"-m",
"uvicorn",
"main:app",
"--host",
host,
"--port",
port,
"--reload", # Add reload flag for development convenience
]
else:
# For non-Windows platforms
cmd = [str(python_executable), "-m", "fastapi", "dev", "--port", "8001"]

logger.info(f"Executing command: {' '.join(cmd)}")

# Start the process (non-blocking)
process = subprocess.Popen(
Expand Down
Loading