handler

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

WebAppHandler

HTTP request handler for the tabbed web UI and JSON API.

Module Contents

class handler.WebAppHandler(request, client_address, server)

Bases: 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 pipeworks_name_generation.webapp.server.create_handler_class().

verbose: bool = True
db_path: pathlib.Path
favorites_db_path: pathlib.Path
db_export_path: pathlib.Path | None = None
db_backup_path: pathlib.Path | None = None
service_log_label: str = 'name-gen-web'
schema_ready: bool = False
schema_initialized_paths: set[str]
favorites_schema_ready: bool = False
favorites_schema_initialized_paths: set[str]
get_routes: dict[str, str]
post_routes: dict[str, str]
log_message(format, *args)

Emit request logs only when verbose mode is enabled.

do_GET()

Handle all supported GET routes.

do_POST()

Handle all supported POST routes.