Files
digifi-EventManager/app/__init__.py
T
CHIEFSOFT\ameye 31a8606679 Added routes
2025-04-12 23:25:22 -04:00

27 lines
654 B
Python

from flask import Flask
from flask_cors import CORS
from app.config import Config
from app.routes import auth_bp, autocall_bp
from app.errors import method_not_allowed, unsupported_media_type
def create_app():
"""Factory function to create a Flask app instance"""
app = Flask(__name__)
# Load configuration
app.config.from_object(Config)
CORS(app)
# Register blueprints
app.register_blueprint(auth_bp)
app.register_blueprint(autocall_bp, url_prefix="/autocall")
# Error Handlers
app.register_error_handler(405, method_not_allowed)
app.register_error_handler(415, unsupported_media_type)
return app