Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/playpauseandstop/aiohttp-middlewares
Collection of useful middlewares for aiohttp.web applications.
https://github.com/playpauseandstop/aiohttp-middlewares
aiohttp aiohttp-server middlewares python python-3 python-3-6 python-3-7 python-3-8 python-library
Last synced: 2 days ago
JSON representation
Collection of useful middlewares for aiohttp.web applications.
- Host: GitHub
- URL: https://github.com/playpauseandstop/aiohttp-middlewares
- Owner: playpauseandstop
- License: bsd-3-clause
- Created: 2017-05-13T12:52:52.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-09-01T05:29:05.000Z (26 days ago)
- Last Synced: 2024-09-15T15:10:22.169Z (12 days ago)
- Topics: aiohttp, aiohttp-server, middlewares, python, python-3, python-3-6, python-3-7, python-3-8, python-library
- Language: Python
- Homepage: http://aiohttp-middlewares.readthedocs.io
- Size: 712 KB
- Stars: 50
- Watchers: 4
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
- Authors: AUTHORS.rst
Awesome Lists containing this project
README
===================
aiohttp-middlewares
===================.. image:: https://github.com/playpauseandstop/aiohttp-middlewares/actions/workflows/ci.yml/badge.svg
:target: https://github.com/playpauseandstop/aiohttp-middlewares/actions/workflows/ci.yml
:alt: CI Workflow.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
:target: https://github.com/pre-commit/pre-commit
:alt: pre-commit.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: black.. image:: https://img.shields.io/pypi/v/aiohttp-middlewares.svg
:target: https://pypi.org/project/aiohttp-middlewares/
:alt: Latest Version.. image:: https://img.shields.io/pypi/pyversions/aiohttp-middlewares.svg
:target: https://pypi.org/project/aiohttp-middlewares/
:alt: Python versions.. image:: https://img.shields.io/pypi/l/aiohttp-middlewares.svg
:target: https://github.com/playpauseandstop/aiohttp-middlewares/blob/main/LICENSE
:alt: BSD License.. image:: https://coveralls.io/repos/playpauseandstop/aiohttp-middlewares/badge.svg?branch=main&service=github
:target: https://coveralls.io/github/playpauseandstop/aiohttp-middlewares
:alt: Coverage.. image:: https://readthedocs.org/projects/aiohttp-middlewares/badge/?version=latest
:target: http://aiohttp-middlewares.readthedocs.org/en/latest/
:alt: DocumentationCollection of useful middlewares for `aiohttp.web`_ applications.
- Works on `Python`_ 3.8+
- Works with `aiohttp.web`_ 3.8.1+
- BSD licensed
- Latest documentation `on Read The Docs
`_
- Source, issues, and pull requests `on GitHub
`_.. _`aiohttp.web`: https://docs.aiohttp.org/en/stable/web.html
.. _`Python`: https://www.python.org/Quick Start
===========By default ``aiohttp.web`` does not provide `many built-in middlewares
`_ for
standart web-development needs such as: handling errors, shielding view
handlers, or providing CORS headers.``aiohttp-middlewares`` tries to fix this by providing several middlewares that
aims to cover most common web-development needs.For example, to enable CORS headers for ``http://localhost:8081`` origin and
handle errors for ``aiohttp.web`` application you need to,.. code-block:: python
from aiohttp import web
from aiohttp_middlewares import (
cors_middleware,
error_middleware,
)app = web.Application(
middlewares=(
cors_middleware(origins=("http://localhost:8081",)),
error_middleware(),
)
)Check `documentation `_ for
all available middlewares and available initialization options.