Update.
This commit is contained in:
parent
97c52a4615
commit
dd6dc8c31a
@ -157,11 +157,13 @@ async def websocket_handler(request):
|
|||||||
return ws
|
return ws
|
||||||
|
|
||||||
async def http_handler(request):
|
async def http_handler(request):
|
||||||
|
print("AAAAA")
|
||||||
request_id = str(uuid.uuid4())
|
request_id = str(uuid.uuid4())
|
||||||
data = None
|
data = None
|
||||||
try:
|
try:
|
||||||
data = await request.json()
|
data = await request.json()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
|
||||||
return web.Response(status=400)
|
return web.Response(status=400)
|
||||||
# application/x-ndjson text/event-stream
|
# application/x-ndjson text/event-stream
|
||||||
if data.get('stream'):
|
if data.get('stream'):
|
||||||
@ -198,7 +200,12 @@ async def models_handler(self):
|
|||||||
response_json = json.dumps(server_manager.get_models(),indent=2)
|
response_json = json.dumps(server_manager.get_models(),indent=2)
|
||||||
return web.Response(text=response_json,content_type="application/json")
|
return web.Response(text=response_json,content_type="application/json")
|
||||||
|
|
||||||
app = web.Application()
|
import logging
|
||||||
|
logging.basicConfig(
|
||||||
|
level=logging.DEBUG
|
||||||
|
)
|
||||||
|
|
||||||
|
app = web.Application(debug=True)
|
||||||
|
|
||||||
app.router.add_get("/", index_handler)
|
app.router.add_get("/", index_handler)
|
||||||
app.router.add_route('GET', '/publish', websocket_handler)
|
app.router.add_route('GET', '/publish', websocket_handler)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user