forked from open-webui/open-webui
fix: disable swagger doc in prod
This commit is contained in:
parent
70d2571be1
commit
04db2475f9
1 changed files with 4 additions and 3 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
import time
|
||||||
|
|
||||||
from fastapi import FastAPI, Request
|
from fastapi import FastAPI, Request
|
||||||
from fastapi.staticfiles import StaticFiles
|
from fastapi.staticfiles import StaticFiles
|
||||||
from fastapi import HTTPException
|
from fastapi import HTTPException
|
||||||
|
@ -12,8 +14,7 @@ from apps.openai.main import app as openai_app
|
||||||
from apps.web.main import app as webui_app
|
from apps.web.main import app as webui_app
|
||||||
from apps.rag.main import app as rag_app
|
from apps.rag.main import app as rag_app
|
||||||
|
|
||||||
|
from config import ENV
|
||||||
import time
|
|
||||||
|
|
||||||
|
|
||||||
class SPAStaticFiles(StaticFiles):
|
class SPAStaticFiles(StaticFiles):
|
||||||
|
@ -27,7 +28,7 @@ class SPAStaticFiles(StaticFiles):
|
||||||
raise ex
|
raise ex
|
||||||
|
|
||||||
|
|
||||||
app = FastAPI()
|
app = FastAPI(docs_url="/docs" if ENV == "dev" else None, redoc_url=None)
|
||||||
|
|
||||||
origins = ["*"]
|
origins = ["*"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue