Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 870 Bytes

README.md

File metadata and controls

29 lines (22 loc) · 870 Bytes

falcon-crossorigin codecov

A simple Falcon module for Cross-Origin Resource Sharing (CORS).

Install

pip install falcon-crossorigin

Usage

import falcon
from falcon_crossorigin import CrossOrigin

cross_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 CORS middleware.