Spaces:
Sleeping
Sleeping
vaka.pro commited on
Commit ·
61b054f
1
Parent(s): a5cb03d
fix: adds redirect from / to /ui
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import os
|
|
| 2 |
import requests
|
| 3 |
import gradio as gr
|
| 4 |
from fastapi import FastAPI, Request, HTTPException
|
| 5 |
-
from fastapi.responses import JSONResponse
|
| 6 |
|
| 7 |
# Конфигурация
|
| 8 |
PRIVATE_SPACE_URL = os.getenv("PRIVATE_SPACE_URL")
|
|
@@ -73,6 +73,11 @@ async def root():
|
|
| 73 |
return JSONResponse(content={"service": "API Gateway", "status": "operational"})
|
| 74 |
|
| 75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
# ==================== Безопасный Gradio интерфейс ====================
|
| 77 |
def create_gradio_interface():
|
| 78 |
with gr.Blocks(title="Proxy Service") as demo:
|
|
|
|
| 2 |
import requests
|
| 3 |
import gradio as gr
|
| 4 |
from fastapi import FastAPI, Request, HTTPException
|
| 5 |
+
from fastapi.responses import JSONResponse, RedirectResponse
|
| 6 |
|
| 7 |
# Конфигурация
|
| 8 |
PRIVATE_SPACE_URL = os.getenv("PRIVATE_SPACE_URL")
|
|
|
|
| 73 |
return JSONResponse(content={"service": "API Gateway", "status": "operational"})
|
| 74 |
|
| 75 |
|
| 76 |
+
@fastapi_app.get("/")
|
| 77 |
+
async def root_redirect():
|
| 78 |
+
return RedirectResponse(url="/ui")
|
| 79 |
+
|
| 80 |
+
|
| 81 |
# ==================== Безопасный Gradio интерфейс ====================
|
| 82 |
def create_gradio_interface():
|
| 83 |
with gr.Blocks(title="Proxy Service") as demo:
|