diff --git a/src/docs/markdown/getting-started.md b/src/docs/markdown/getting-started.md index d34ce2b..bd8c6df 100644 --- a/src/docs/markdown/getting-started.md +++ b/src/docs/markdown/getting-started.md @@ -52,6 +52,9 @@ This blocks forever, but what is it doing? At the moment... nothing. By default, We can make Caddy useful by giving it a config. This can be done many ways, but we'll start by making a POST request to the [/load](/docs/api#post-load) endpoint using `curl` in the next section. + ## Your first config @@ -122,11 +125,12 @@ Another way to configure Caddy is with the [**Caddyfile**](/docs/caddyfile). The respond "Hello, world!" ``` - Save that to a file named `Caddyfile` (no extension) in the current directory. +Next we check if the configuration is valid. + Stop Caddy if it is already running (Ctrl+C), then run:
caddy adapt
@@ -135,9 +139,14 @@ Or if you stored the Caddyfile somewhere else or named it something other than `
caddy adapt --config /path/to/Caddyfile
-You will see JSON output! What happened here? +If you made no errors, you will see JSON output! What happened here? + +We just used a [_config adapter_](/docs/config-adapters) to convert our Caddyfile to Caddy's native JSON structure. + + -We just used a [_config adapter_](/docs/config-adapters) to convert our Caddyfile to Caddy's native JSON structure. @@ -176,6 +185,7 @@ Full range of Caddy functionality | Most common parts of Caddy functionality Easy to generate | Easy to craft by hand Easily programmable | Difficult to automate Extremely expressive | Moderately expressive +Hard to read | Easy to read Allows config traversal | Cannot traverse within Caddyfile Partial config changes | Whole config changes only Can be exported | Cannot be exported @@ -188,7 +198,11 @@ Kind of boring | Kind of fun You will need to decide which is best for your use case. -It is important to note that both JSON and the Caddyfile (and [any other supported config adapter](/docs/config-adapters)) can be used with [Caddy's API](/docs/api). However, you get the full range of Caddy's functionality and API features if you use JSON. If using a config adapter, the only way to load or change the config with the API is the [/load endpoint](/docs/api#post-load). + + +It is important to note that both JSON and the Caddyfile (and [any other supported config adapter](/docs/config-adapters)) can be used with [Caddy's API](/docs/api). However, you only get the full range of Caddy's functionality and API features if you use JSON. If using a config adapter, the only way to load or change the config with the API is the [/load endpoint](/docs/api#post-load). @@ -222,7 +236,6 @@ As you can see, Caddy is well-suited for a wide variety of use cases and deploym - ## Start, stop, run Since Caddy is a server, it runs indefinitely. That means your terminal won't unblock after you execute `caddy run` until the process is terminated (usually with Ctrl+C). @@ -266,4 +279,4 @@ If there are any errors loading the new config, Caddy rolls back to the last wor Technically, the new config is started before the old config is stopped, so for a brief time, both configs are running! If the new config fails, it aborts with an error, while the old one is simply not stopped. - \ No newline at end of file +