Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexferl/falcon-crossorigin
A simple Falcon module for Cross-Origin Resource Sharing (CORS)
https://github.com/alexferl/falcon-crossorigin
cors cors-enabled falcon falcon-cors falcon-framework falcon-middleware python-falcon
Last synced: 3 months ago
JSON representation
A simple Falcon module for Cross-Origin Resource Sharing (CORS)
- Host: GitHub
- URL: https://github.com/alexferl/falcon-crossorigin
- Owner: alexferl
- License: mit
- Created: 2020-05-01T04:11:14.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-15T20:27:45.000Z (6 months ago)
- Last Synced: 2024-09-17T20:29:52.576Z (4 months ago)
- Topics: cors, cors-enabled, falcon, falcon-cors, falcon-framework, falcon-middleware, python-falcon
- Language: Python
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# falcon-crossorigin [![codecov](https://codecov.io/gh/alexferl/falcon-crossorigin/branch/master/graph/badge.svg)](https://codecov.io/gh/alexferl/falcon-crossorigin)
A simple [Falcon](https://github.com/falconry/falcon) module for Cross-Origin Resource Sharing (CORS).
## Install
```shell script
pip install falcon-crossorigin
```## Usage
```python
import falcon
from falcon_crossorigin import CrossOrigincross_origin = CrossOrigin(
allow_origins="https://app.example.com",
allow_methods="GET,POST",
allow_headers="Pragma,Expires,Cache-Control",
allow_credentials=True,
expose_headers="Link",
max_age=3600,
)api = falcon.API(middleware=[cross_origin])
```## Credits
Port of [Echo's](https://github.com/labstack/echo) [CORS middleware](https://github.com/labstack/echo/blob/1f6cc362cc91b22e5889b2674e45cf3545d6ee21/middleware/cors.go).