MCPcopy
hub / github.com/aio-libs/aiohttp / init

Function init

examples/web_rewrite_headers_middleware.py:32–39  ·  view source on GitHub ↗
(loop)

Source from the content-addressed store, hash-verified

30
31@asyncio.coroutine
32def init(loop):
33 app = Application(loop=loop, middlewares=[middleware_factory])
34 app.router.add_route('GET', '/', handler)
35
36 requests_handler = app.make_handler()
37 srv = yield from loop.create_server(requests_handler, '127.0.0.1', 8080)
38 print("Server started at http://127.0.0.1:8080")
39 return srv, requests_handler
40
41
42loop = asyncio.get_event_loop()

Calls 4

make_handlerMethod · 0.95
ApplicationClass · 0.90
add_routeMethod · 0.45
create_serverMethod · 0.45

Tested by

no test coverage detected