Files
chisup/app/__init__.py
T

21 lines
508 B
Python
Raw Normal View History

2026-07-04 23:20:40 +08:00
from flask import Flask
from app.config import BaseConfig, load_config_from_env
2026-07-04 23:20:40 +08:00
def create_app(config_object=None):
app = Flask(__name__)
app.config.from_object(BaseConfig)
app.config.update(load_config_from_env())
2026-07-04 23:20:40 +08:00
if config_object:
if isinstance(config_object, dict):
app.config.update(config_object)
else:
app.config.from_object(config_object)
from app.api.health import bp as health_bp
app.register_blueprint(health_bp)
return app