ruta serve chat

This commit is contained in:
Sebarocks 2025-08-06 00:40:42 -04:00
parent 687a4cccb6
commit b5015a8c4c

5
app.py
View file

@ -21,8 +21,13 @@ async def serve_frontend(request):
"""Serve the frontend index.html file""" """Serve the frontend index.html file"""
return FileResponse(os.path.join("frontend", "dist", "index.html")) return FileResponse(os.path.join("frontend", "dist", "index.html"))
async def serve_chat(request):
"""Serve the chat.html file for specific chat routes"""
return FileResponse(os.path.join("frontend", "dist", "chat.html"))
routes = [ routes = [
Route("/", serve_frontend, methods=["GET"]), Route("/", serve_frontend, methods=["GET"]),
Route("/chats/{chat_id:str}", serve_chat, methods=["GET"]),
Route("/api/models", get_models, methods=["GET"]), Route("/api/models", get_models, methods=["GET"]),
Route("/api/chats", create_chat, methods=["POST"]), Route("/api/chats", create_chat, methods=["POST"]),
Route("/api/chats/{chat_id:str}", history, methods=["GET"]), Route("/api/chats/{chat_id:str}", history, methods=["GET"]),