changed to gunicorn

This commit is contained in:
2022-08-16 12:34:47 +03:00
parent 734bbd836e
commit ea7933793c
4 changed files with 24 additions and 26 deletions

View File

@@ -66,18 +66,17 @@ async def webhook(request: web.Request) -> web.Response:
return web.Response(status=HTTPStatus.OK)
def create_app() -> web.Application:
async def create_app() -> web.Application:
application = web.Application()
application.router.add_post('/', webhook)
return application
if __name__ == '__main__':
import uvicorn
if START_WITH_WEBHOOK:
# bot_webhook() # type: ignore
app = create_app()
uvicorn.run(app=app, host=WEBAPP_HOST, port=WEBAPP_PORT)
web.run_app(app=app, host=WEBAPP_HOST, port=WEBAPP_PORT)
else:
bot_polling()