|
|
@ -12,8 +12,6 @@ from typing import (
|
|
|
|
)
|
|
|
|
)
|
|
|
|
from .config import Config
|
|
|
|
from .config import Config
|
|
|
|
|
|
|
|
|
|
|
|
ENDPOINT = "/webhook"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def run_webhook(
|
|
|
|
async def run_webhook(
|
|
|
|
alert_queue: asyncio.Queue[dict[str, Any]],
|
|
|
|
alert_queue: asyncio.Queue[dict[str, Any]],
|
|
|
|
config: Config
|
|
|
|
config: Config
|
|
|
@ -28,7 +26,7 @@ async def run_webhook(
|
|
|
|
return aiohttp.web.Response()
|
|
|
|
return aiohttp.web.Response()
|
|
|
|
|
|
|
|
|
|
|
|
app = aiohttp.web.Application()
|
|
|
|
app = aiohttp.web.Application()
|
|
|
|
app.add_routes([aiohttp.web.post(ENDPOINT, handler)])
|
|
|
|
app.add_routes([aiohttp.web.post(config.endpoint, handler)])
|
|
|
|
runner = aiohttp.web.AppRunner(app)
|
|
|
|
runner = aiohttp.web.AppRunner(app)
|
|
|
|
await runner.setup()
|
|
|
|
await runner.setup()
|
|
|
|
site = aiohttp.web.TCPSite(runner, config.host, config.port)
|
|
|
|
site = aiohttp.web.TCPSite(runner, config.host, config.port)
|
|
|
|