handler ======= .. py:module:: handler .. autoapi-nested-parse:: HTTP request handler for Pipeworks webapp endpoints. The handler intentionally focuses on transport concerns: - request logging policy - JSON/text response helpers - one-time schema bootstrap guard - GET/POST dispatch through route registries Route-specific behavior lives in ``endpoint_adapters.py`` and ``routes/*``. Classes ------- .. autoapisummary:: handler.WebAppHandler Module Contents --------------- .. py:class:: WebAppHandler(request, client_address, server) Bases: :py:obj:`http.server.BaseHTTPRequestHandler` HTTP request handler for the tabbed web UI and JSON API. Class attributes ``verbose`` and ``db_path`` are injected at startup by :func:`pipeworks_name_generation.webapp.server.create_handler_class`. .. py:attribute:: verbose :type: bool :value: True .. py:attribute:: db_path :type: pathlib.Path .. py:attribute:: favorites_db_path :type: pathlib.Path .. py:attribute:: db_export_path :type: pathlib.Path | None :value: None .. py:attribute:: db_backup_path :type: pathlib.Path | None :value: None .. py:attribute:: service_log_label :type: str :value: 'name-gen-web' .. py:attribute:: schema_ready :type: bool :value: False .. py:attribute:: schema_initialized_paths :type: set[str] .. py:attribute:: favorites_schema_ready :type: bool :value: False .. py:attribute:: favorites_schema_initialized_paths :type: set[str] .. py:attribute:: get_routes :type: dict[str, str] .. py:attribute:: post_routes :type: dict[str, str] .. py:method:: log_message(format, *args) Emit request logs only when verbose mode is enabled. .. py:method:: do_GET() Handle all supported ``GET`` routes. .. py:method:: do_POST() Handle all supported ``POST`` routes.