Update app.py
Browse files
app.py
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
-
from fastapi import FastAPI
|
| 2 |
from fastapi.responses import RedirectResponse
|
| 3 |
import subprocess
|
| 4 |
import threading
|
| 5 |
|
| 6 |
app = FastAPI()
|
| 7 |
|
| 8 |
-
# Start Open WebUI in
|
| 9 |
-
|
| 10 |
-
subprocess.run(["open-webui", "serve"])
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
# Redirect to Open WebUI's port (default: 8080)
|
| 15 |
@app.get("/")
|
| 16 |
-
def
|
| 17 |
return RedirectResponse(url="http://localhost:8080")
|
|
|
|
| 1 |
+
from fastapi import FastAPI
|
| 2 |
from fastapi.responses import RedirectResponse
|
| 3 |
import subprocess
|
| 4 |
import threading
|
| 5 |
|
| 6 |
app = FastAPI()
|
| 7 |
|
| 8 |
+
# Start Open WebUI in background
|
| 9 |
+
threading.Thread(
|
| 10 |
+
target=lambda: subprocess.run(["open-webui", "serve"]),
|
| 11 |
+
daemon=True
|
| 12 |
+
).start()
|
| 13 |
|
| 14 |
+
# Redirect to Open WebUI's port (8080)
|
|
|
|
|
|
|
| 15 |
@app.get("/")
|
| 16 |
+
def home():
|
| 17 |
return RedirectResponse(url="http://localhost:8080")
|