[0241e6]: / api / app / __init__.py

Download this file

13 lines (9 with data), 364 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from flask import Flask
from flask_cors import CORS
def create_app():
app = Flask(__name__)
app.config.from_object('app.config.Config')
from app.routes import blueprint
CORS(blueprint, supports_credentials=True, resources={r"/api/v1/*": {"origins": "*"}}) # Change this
app.register_blueprint(blueprint, url_prefix='/api/v1')
return app