docs: quick-starts: api: Remove tabs from heredoc (#43)

This commit is contained in:
John Andersen 2020-05-17 08:46:31 -07:00 committed by GitHub
parent 9594e4bc4b
commit 68e003409a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,28 +17,28 @@ First start Caddy:
Caddy is currently running idle (with a blank configuration). Give it a simple config with `curl`: Caddy is currently running idle (with a blank configuration). Give it a simple config with `curl`:
<pre><code class="cmd bash">curl localhost:2019/load \ <pre><code class="cmd bash">curl localhost:2019/load \
-X POST \ -X POST \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d @- << EOF -d @- << EOF
{ {
"apps": { "apps": {
"http": { "http": {
"servers": { "servers": {
"hello": { "hello": {
"listen": [":2015"], "listen": [":2015"],
"routes": [ "routes": [
{ {
"handle": [{ "handle": [{
"handler": "static_response", "handler": "static_response",
"body": "Hello, world!" "body": "Hello, world!"
}] }]
} }
] ]
} }
} }
} }
} }
} }
EOF</code></pre> EOF</code></pre>
Giving a POST body with [Heredoc](https://en.wikipedia.org/wiki/Here_document#Unix_shells) can be tedious, so if you prefer to use files, save the JSON to a file called `caddy.json` and then use this command instead: Giving a POST body with [Heredoc](https://en.wikipedia.org/wiki/Here_document#Unix_shells) can be tedious, so if you prefer to use files, save the JSON to a file called `caddy.json` and then use this command instead: