Startar upp allla tjänster

This commit is contained in:
Joakim Persson
2024-07-16 17:19:39 +02:00
parent c39b831a59
commit 99e3737718
+23
View File
@@ -0,0 +1,23 @@
# Start all services
import subprocess
import threading
from backend import run_flask
def start_frontend():
try:
# Start frontend (web server) as a separate process
subprocess.Popen(["python", "-m", "http.server", "8000"])
except Exception as e:
print(f"Failed to start frontend: {e}")
def start_backend():
try:
# Start backend as a separate thread
threading.Thread(target=run_flask).start()
except Exception as e:
print(f"Failed to start backend: {e}")
if __name__ == '__main__':
start_backend()
start_frontend()