12345678910111213141516171819202122 |
- from flask import Flask
- import os
- from flask_cors import CORS
- def create_app():
- SECRET_KEY = os.urandom(32)
- app = Flask(__name__)
- CORS(app, resources={r"/api/*": {"origins": "*"}})
- app.config['SECRET_KEY'] = SECRET_KEY
- from models.contents.routes import contents_app
- from models.manages.routes import manages_app
- from models.store_locations.routes import store_locations_app
- from models.statics.routes import statics_app
- app.register_blueprint(contents_app)
- app.register_blueprint(manages_app)
- app.register_blueprint(store_locations_app)
- app.register_blueprint(statics_app)
- return app
|