From cb221940673286b7960d9454db247de4bffc1c4c Mon Sep 17 00:00:00 2001 From: Dmitry Afanasyev Date: Tue, 16 Aug 2022 21:48:39 +0300 Subject: [PATCH] not working again --- app/main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/main.py b/app/main.py index 1c94166..2fb3091 100644 --- a/app/main.py +++ b/app/main.py @@ -7,13 +7,7 @@ from aiohttp import web from app.core.bot import bot, dispatcher from app.core.logger import logger from app.core.scheduler import asyncio_schedule -from app.settings import ( - START_WITH_WEBHOOK, - WEBAPP_HOST, - WEBAPP_PORT, - WEBHOOK_PATH, - WEBHOOK_URL, -) +from app.settings import START_WITH_WEBHOOK, WEBAPP_HOST, WEBAPP_PORT, WEBHOOK_URL async def bot_startup() -> None: @@ -81,9 +75,15 @@ async def webhook(request: web.Request) -> web.Response: return web.Response(status=HTTPStatus.OK) +async def hello_world(request: web.Request) -> web.Response: + logger.info(request) + return web.Response(body='Hello World') + + async def create_app() -> web.Application: application = web.Application() application.router.add_post('/', webhook) + application.router.add_post('/hello', hello_world) application.on_startup.append(on_startup_gunicorn) application.on_shutdown.append(on_shutdown_gunicorn) return application