mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-14 03:27:59 +00:00
28 lines
524 B
Python
28 lines
524 B
Python
import asyncio
|
|
import aiohttp.web
|
|
import logging
|
|
|
|
from . import app
|
|
from .irc import irc_bot
|
|
|
|
|
|
async def start_webserver():
|
|
runner = aiohttp.web.AppRunner(app)
|
|
await runner.setup()
|
|
|
|
logging.info('Starting webserver at localhost:8080')
|
|
|
|
site = aiohttp.web.TCPSite(runner, 'localhost', 8080)
|
|
await site.start()
|
|
|
|
|
|
def main():
|
|
loop = asyncio.get_event_loop()
|
|
asyncio.ensure_future(start_webserver())
|
|
asyncio.ensure_future(irc_bot())
|
|
loop.run_forever()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|