Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,6 +44,15 @@ settings = {
|
|
| 44 |
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
| 45 |
logger.info("Static files are being served from the 'static' directory.")
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
@app.get("/custom-auth")
|
| 48 |
async def custom_auth():
|
| 49 |
# Verify the user's identity with custom logic.
|
|
@@ -80,14 +89,7 @@ async def on_message(message: cl.Message):
|
|
| 80 |
await msg.update()
|
| 81 |
logger.info("Message processed and response sent.")
|
| 82 |
|
| 83 |
-
|
| 84 |
-
async def catch_all(full_path: str):
|
| 85 |
-
"""
|
| 86 |
-
Catch-all route to serve index.html for any undefined routes,
|
| 87 |
-
allowing client-side routing to function properly.
|
| 88 |
-
"""
|
| 89 |
-
logger.info(f"Serving static file for path: {full_path}")
|
| 90 |
-
return FileResponse('static/index.html')
|
| 91 |
|
| 92 |
# from fastapi import FastAPI
|
| 93 |
# from fastapi.staticfiles import StaticFiles
|
|
|
|
| 44 |
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
| 45 |
logger.info("Static files are being served from the 'static' directory.")
|
| 46 |
|
| 47 |
+
@app.get("/")
|
| 48 |
+
def read_root():
|
| 49 |
+
"""
|
| 50 |
+
Catch-all route to serve index.html for any undefined routes,
|
| 51 |
+
allowing client-side routing to function properly.
|
| 52 |
+
"""
|
| 53 |
+
logger.info(f"Serving static file for path")
|
| 54 |
+
return FileResponse('static/index.html')
|
| 55 |
+
|
| 56 |
@app.get("/custom-auth")
|
| 57 |
async def custom_auth():
|
| 58 |
# Verify the user's identity with custom logic.
|
|
|
|
| 89 |
await msg.update()
|
| 90 |
logger.info("Message processed and response sent.")
|
| 91 |
|
| 92 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
# from fastapi import FastAPI
|
| 95 |
# from fastapi.staticfiles import StaticFiles
|