ruta serve chat
This commit is contained in:
parent
687a4cccb6
commit
b5015a8c4c
1 changed files with 5 additions and 0 deletions
5
app.py
5
app.py
|
|
@ -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"]),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue