问题 The following code taken from the aiohttp docs https://docs.aiohttp.org/en/stable/ does work: from aiohttp import web async def handle(request): name = request.match_info.get('name', "Anonymous") text = "Hello, " + name return web.Response(text=text) app = web.Application() app.add_routes([web.get('/', handle), web.get('/{name}', handle)]) if __name__ == '__main__': web.run_app(app) But having the webserver hijack the main thread is not acceptable: the webserver should be on a separate non