Build a Caddy automatic_https config block.
automatic_https
Symmetric to collectExternalHostsFromRoutes: pass the result of that walker as skip to derive the skip list dynamically from the live routes.
skip
Returns undefined when no field would be set, so the caller can conditionally assign without polluting the config with empty objects:
undefined
const auto = buildAutomaticHttpsConfig({ skip: hosts, disableRedirects: true }); if (auto) server.automatic_https = auto;
https://caddyserver.com/docs/json/apps/http/servers/automatic_https/
Build a Caddy
automatic_httpsconfig block.Symmetric to collectExternalHostsFromRoutes: pass the result of that walker as
skipto derive the skip list dynamically from the live routes.Returns
undefinedwhen no field would be set, so the caller can conditionally assign without polluting the config with empty objects:const auto = buildAutomaticHttpsConfig({ skip: hosts, disableRedirects: true }); if (auto) server.automatic_https = auto;