Remove unnecessary uvicorn layer
Additional arg parsing was breaking things
This commit is contained in:
parent
1b16301a17
commit
d72867529a
@ -1,20 +1,9 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import uvicorn
|
|
||||||
from open_webui import app
|
from open_webui import app
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(description="GlowPath Backend Server")
|
|
||||||
parser.add_argument(
|
|
||||||
"--port", type=int, default=8080, help="Port to run the server on"
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--host", type=str, default="127.0.0.1", help="Host to bind the server to"
|
|
||||||
)
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
# Set up Open WebUI environment variables if they're provided
|
# Set up Open WebUI environment variables if they're provided
|
||||||
# These will be set by the Tauri app for proper data persistence
|
# These will be set by the Tauri app for proper data persistence
|
||||||
data_dir = os.environ.get("DATA_DIR")
|
data_dir = os.environ.get("DATA_DIR")
|
||||||
@ -33,7 +22,7 @@ def main():
|
|||||||
os.makedirs(os.environ["WEBUI_CACHE_DIR"], exist_ok=True)
|
os.makedirs(os.environ["WEBUI_CACHE_DIR"], exist_ok=True)
|
||||||
|
|
||||||
# Run the FastAPI app using uvicorn
|
# Run the FastAPI app using uvicorn
|
||||||
uvicorn.run(app, host=args.host, port=args.port, log_level="info")
|
app()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@ -74,7 +74,7 @@ async fn start_backend(app: tauri::AppHandle) -> Result<u16, String> {
|
|||||||
.shell()
|
.shell()
|
||||||
.sidecar("glowpath-backend")
|
.sidecar("glowpath-backend")
|
||||||
.map_err(|e| format!("Failed to create sidecar command: {}", e))?
|
.map_err(|e| format!("Failed to create sidecar command: {}", e))?
|
||||||
.args(&["serve", "--port", &port.to_string()])
|
.args(&["serve", "--host", "127.0.0.1", "--port", &port.to_string()])
|
||||||
.env("WEBUI_SECRET_KEY", &generate_secret_key()) // Generate a proper secret
|
.env("WEBUI_SECRET_KEY", &generate_secret_key()) // Generate a proper secret
|
||||||
.env("DATA_DIR", &webui_data_dir)
|
.env("DATA_DIR", &webui_data_dir)
|
||||||
.env(
|
.env(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user