sedi-relay/relay/__main__.py
2018-10-30 02:49:00 +00:00

26 lines
462 B
Python

import asyncio
import aiohttp.web
import logging
from . import app
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())
loop.run_forever()
if __name__ == '__main__':
main()