corydolphin / flask-cors

Cross Origin Resource Sharing ( CORS ) support for Flask
https://flask-cors.readthedocs.io/en/latest/index.html
MIT License
884 stars 139 forks source link

missing documentation on configuration options #274

Closed bbbart closed 4 years ago

bbbart commented 4 years ago

Hi,

After using flask-cors for a while, I was getting a bit frustrated I seemed to have to configure my CORS settings when instantiating the CORS object, which meant I couldn't include the config in my app configuration.

Only after stumbling upon a hint deep in the documentation about CORS_* options (https://flask-cors.corydolphin.com/en/latest/api.html#extension) and subsequently going through the code (https://github.com/corydolphin/flask-cors/blob/master/flask_cors/core.py#L38), I figured out I could configure flask-cors together with the other flask extensions.

I'm suggesting to update the documentation on this matter (or did I just miss it?).

corydolphin commented 4 years ago

Hey @bbbart thanks for taking the time to create an issue, I really appreciate it! There is some very light documentation of this. If you are up for it, I would happily merge a change to improve the documentation. I agree, using app configuration is likely the best practice, if you have the energy and could add a small snippet describing the options, it would be incredible! 🙌

image

bbbart commented 4 years ago

I'm working on something... let me propose a pull request on this soon.

bbbart commented 4 years ago

please have a look at pull request https://github.com/corydolphin/flask-cors/pull/277 :-)

bbbart commented 4 years ago

documentation updated