0 purchases
aiohttpcompress 0.2.1
aiohttp-compress
This module is the simplest way to enable compression support for aiohttp server applications globally.
Installation
pip install aiohttp-compress
Example
from aiohttp import web
from aiohttp_compress import compress_middleware
async def handle(request):
name = request.match_info.get(
'name', "Anonymous"
)
text = "Hello, " + name
return web.Response(text=text)
app = web.Application()
app.middlewares.append(compress_middleware)
app.add_routes([
web.get('/', handle),
web.get('/{name}', handle)
])
if __name__ == '__main__':
web.run_app(app)
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.