Load a Caddyfile and convert it to Caddy JSON format
Convenience function for loading Caddyfile-formatted configuration. Equivalent to loadConfig(path, "caddyfile", options).
loadConfig(path, "caddyfile", options)
Path to the Caddyfile
Optional
Loading options (adminUrl, timeout)
The parsed Caddy configuration object
If the file content is empty or invalid
If Caddy cannot parse the Caddyfile
If unable to connect to Caddy Admin API
If the request times out
const config = await loadCaddyfile("./Caddyfile");// Modify the configconfig.apps.http.servers.srv0.routes.push(myNewRoute);// Apply to running Caddyawait client.applyConfig(config); Copy
const config = await loadCaddyfile("./Caddyfile");// Modify the configconfig.apps.http.servers.srv0.routes.push(myNewRoute);// Apply to running Caddyawait client.applyConfig(config);
Load a Caddyfile and convert it to Caddy JSON format
Convenience function for loading Caddyfile-formatted configuration. Equivalent to
loadConfig(path, "caddyfile", options).