擅长:python、mysql、java
<p>aiohttp 3.1支持<a href="https://docs.aiohttp.org/en/stable/deployment.html#application-factory" rel="nofollow noreferrer">coroutine as application factory</a>,例如:</p>
<pre><code>async def my_web_app():
app = web.Application()
app.router.add_get('/', index)
return app
</code></pre>
<p>aiohttpdemo_投票的<a href="https://github.com/aio-libs/aiohttp-demos/blob/0a59dc5efd13a9dfb0c36cc02decd5ba64750a87/demos/polls/aiohttpdemo_polls/main.py#L14" rel="nofollow noreferrer">Current implementation</a>使用这种方法。可以从</p>
^{pr2}$