Startar upp allla tjänster
This commit is contained in:
@@ -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()
|
||||||
Reference in New Issue
Block a user