File size: 566 Bytes
2ae3f7c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
import subprocess
import sys
from multiprocessing import Process

def run_backend():
    from app.main import app
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000)

def run_frontend():
    subprocess.run([sys.executable, "app/frontend.py"])

if __name__ == "__main__":
    # Start backend in a separate process
    backend_process = Process(target=run_backend)
    backend_process.start()
    
    # Run frontend in the main process
    run_frontend()
    
    # Wait for backend to finish
    backend_process.join()