NAME
Developer::Dashboard::Web::Server - PSGI server bridge for Developer Dashboard
SYNOPSIS
my $server = Developer::Dashboard::Web::Server->new(app => $app);
$server->run;
DESCRIPTION
This module reserves the local listen address, builds the Dancer2 PSGI app, and runs it under Starman through Plack::Runner.
METHODS
new, run, start_daemon, listening_url, serve_daemon, psgi_app, _build_runner, _default_headers, generate_self_signed_cert, get_ssl_cert_paths
Construct and run the local PSGI web server with optional SSL/HTTPS support.
When ssl = 1> is passed to new(), generates or refreshes self-signed certificates in ~/.developer-dashboard/certs/ with SAN coverage for localhost, 127.0.0.1, ::1, the concrete non-wildcard bind host, and any configured extra aliases/IPs, runs an internal HTTPS Starman backend, exposes a public frontend on the requested port, redirects plain HTTP requests on that public port to the equivalent https://... URL, and proxies real HTTPS traffic through to the internal backend. The listening_url() method returns https:// when SSL is enabled.
SSL SUPPORT
Pass ssl = 1> to the new() constructor to enable HTTPS:
my $server = Developer::Dashboard::Web::Server->new(
app => $app,
ssl => 1,
);
$server->run;
Self-signed certificates are generated automatically in ~/.developer-dashboard/certs/ and reused on subsequent runs when they already match the expected browser-safe localhost/loopback profile plus any configured SAN aliases or IP literals. Older legacy dashboard certs without the required SAN and server-auth extensions are regenerated automatically.
PURPOSE
Perl module in the Developer Dashboard codebase. This file starts, supervises, and configures the local HTTP and HTTPS dashboard server processes. Open this file when you need the implementation, regression coverage, or runtime entrypoint for that responsibility rather than guessing which part of the tree owns it.
WHY IT EXISTS
It exists to keep this responsibility in reusable Perl code instead of hiding it in the thin dashboard switchboard, bookmark text, or duplicated helper scripts. That separation makes the runtime easier to test, safer to change, and easier for contributors to navigate.
WHEN TO USE
Use this file when you are changing the underlying runtime behaviour it owns, when you need to call its routines from another part of the project, or when a failing test points at this module as the real owner of the bug.
HOW TO USE
Load Developer::Dashboard::Web::Server from Perl code under lib/ or from a focused test, then use the public routines documented in the inline function comments and existing SYNOPSIS/METHODS sections. This file is not a standalone executable.
WHAT USES IT
This file is used by whichever runtime path owns this responsibility: the public dashboard entrypoint, staged private helper scripts under share/private-cli/, the web runtime, update flows, and the focused regression tests under t/.
EXAMPLES
perl -Ilib -MDeveloper::Dashboard::Web::Server -e 'print qq{loaded\n}'
That example is only a quick load check. For real usage, follow the public routines already described in the inline code comments and any existing SYNOPSIS section.