8e61dc4df4
The frontend blueprint is registered after the api blueprint so /api/* routes are matched first; everything else falls through to the SPA. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
23 lines
474 B
Python
23 lines
474 B
Python
"""Quart app factory."""
|
|
|
|
import logging
|
|
|
|
from quart import Quart
|
|
|
|
from .api import api_bp
|
|
from .config import get_config
|
|
from .frontend import frontend_bp
|
|
|
|
|
|
def create_app() -> Quart:
|
|
cfg = get_config()
|
|
logging.basicConfig(level=cfg.log_level)
|
|
|
|
app = Quart(__name__)
|
|
app.secret_key = cfg.secret_key
|
|
app.register_blueprint(api_bp)
|
|
# Registered last so /api/* routes win over the SPA catch-all.
|
|
app.register_blueprint(frontend_bp)
|
|
|
|
return app
|