Uhhy commited on
Commit
229b6e3
1 Parent(s): 391a666

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -115,8 +115,13 @@ async def run_server(port: int):
115
  async def serve_request(request: httpx.Request) -> httpx.Response:
116
  return await handle_request(request)
117
 
118
- server = await httpx.serve(serve_request, host="localhost", port=port)
119
- await server.aclose()
 
 
 
 
 
120
 
121
  def remove_repetitive_responses(responses):
122
  unique_responses = {}
 
115
  async def serve_request(request: httpx.Request) -> httpx.Response:
116
  return await handle_request(request)
117
 
118
+ from uvicorn.config import Config
119
+ from uvicorn.main import Server
120
+
121
+ config = Config(app=serve_request, host="127.0.0.1", port=port, log_level="info")
122
+ server = Server(config=config)
123
+
124
+ await server.serve()
125
 
126
  def remove_repetitive_responses(responses):
127
  unique_responses = {}