cors init
This commit is contained in:
parent
b10465e353
commit
6d712685d5
@ -1,5 +1,6 @@
|
|||||||
from flask import Flask
|
from flask import Flask
|
||||||
from app.routes import main
|
from app.routes import main
|
||||||
|
from flask_cors import CORS
|
||||||
import os
|
import os
|
||||||
|
|
||||||
def create_app():
|
def create_app():
|
||||||
@ -7,5 +8,6 @@ def create_app():
|
|||||||
template_path = os.path.join(base_dir, '..', 'templates')
|
template_path = os.path.join(base_dir, '..', 'templates')
|
||||||
static_path = os.path.join(base_dir, '..','static')
|
static_path = os.path.join(base_dir, '..','static')
|
||||||
app = Flask(__name__, template_folder=template_path, static_folder=static_path)
|
app = Flask(__name__, template_folder=template_path, static_folder=static_path)
|
||||||
|
CORS(app, resources={r"/api/*": {"origins": "*"}})
|
||||||
app.register_blueprint(main)
|
app.register_blueprint(main)
|
||||||
return app
|
return app
|
||||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user