mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-22 21:48:12 -05:00
fix(server): only mount the static files if the _next directory exists
This commit is contained in:
@@ -203,11 +203,13 @@ class AgentServer(AppService):
|
||||
#! DO NOT ADD ANY FUNCTIONS BETWEEN THESE FUNCTIONS
|
||||
#! DO NOT REMOVE ANY OF THESE FUNCTIONS
|
||||
#! YOU WILL BREAK THE FRONTEND PACKAGED WITH THE SERVER
|
||||
app.mount(
|
||||
path="/_next",
|
||||
app=SPAStaticFiles(directory=get_frontend_path() / "_next", html=True),
|
||||
name="frontend",
|
||||
)
|
||||
|
||||
if os.path.exists(get_frontend_path() / "_next"):
|
||||
app.mount(
|
||||
path="/_next",
|
||||
app=SPAStaticFiles(directory=get_frontend_path() / "_next", html=True),
|
||||
name="frontend",
|
||||
)
|
||||
|
||||
@app.websocket("/ws")
|
||||
async def websocket_endpoint(websocket: WebSocket): # type: ignore
|
||||
|
||||
Reference in New Issue
Block a user