Enable CORS (cross origin resource sharing) with Flask

Опубликовано: 04 Октябрь 2024
на канале: Demos Petsas
997
16

In this flask CORS tutorial we will learn how to use flask-cors a Flask package for adding Access-Control-Allow-Origin headers to your API in order to be able to consume it from your frontend when they are on different origins that is have either a different host, port or scheme.

Chapters:
0:00 Intro
0:26 Install flask-cors
1:06 Add extension
1:13 Initialise extension
2:03 Customise origins and endpoints
3:49 Using the cross_origin decorator

Code:
https://github.com/demoskp/flask-cors...

Personal website:
http://www.petsas.consulting