Skip to content

Commit 3ff97e8

Browse files
authored
JSON Response
JSON response on /
1 parent 5289ec3 commit 3ff97e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import asyncio
55
import websockets
66
from fastapi import FastAPI, WebSocket, Request
7-
from fastapi.responses import HTMLResponse
7+
from fastapi.responses import HTMLResponse, JSONResponse
88
from fastapi.websockets import WebSocketDisconnect
99
from twilio.twiml.voice_response import VoiceResponse, Connect, Say, Stream
1010
from dotenv import load_dotenv
@@ -34,7 +34,7 @@
3434
if not OPENAI_API_KEY:
3535
raise ValueError('Missing the OpenAI API key. Please set it in the .env file.')
3636

37-
@app.get("/", response_class=HTMLResponse)
37+
@app.get("/", response_class=JSONResponse)
3838
async def index_page():
3939
return {"message": "Twilio Media Stream Server is running!"}
4040

@@ -224,4 +224,4 @@ async def initialize_session(openai_ws):
224224

225225
if __name__ == "__main__":
226226
import uvicorn
227-
uvicorn.run(app, host="0.0.0.0", port=PORT)
227+
uvicorn.run(app, host="0.0.0.0", port=PORT)

0 commit comments

Comments
 (0)