mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 20:46:15 -04:00
docs: quick-starts: api: Remove tabs from heredoc (#43)
This commit is contained in:
parent
9594e4bc4b
commit
68e003409a
1 changed files with 20 additions and 20 deletions
|
@ -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:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue