docs: Add embedded filesystem declaration to --embed example (#204)

* Add `embedded` filesystem declaration to `--embed` example

Also mention the filesystem explicitly in the preceding sentence

* Revise to avoid stutter in fs name and module name

* Add an explanatory comment to example Caddyfile as well
This commit is contained in:
Cameron Martin 2024-09-20 15:55:07 -07:00 committed by GitHub
parent b72e330d5d
commit 16f248e6d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -116,22 +116,29 @@ This allows you to hack on Caddy core (and optionally plug in extra modules at t
---
You may embed directories into the Caddy executable:
You may embed directories into the Caddy executable and serve them from the `embedded` filesystem module:
```
$ xcaddy build --embed foo:./sites/foo --embed bar:./sites/bar
$ cat Caddyfile
{
# You must declare a custom filesystem using the `embedded` module.
# The first argument to `filesystem` is an arbitrary identifier
# that will also be passed to `fs` directives.
filesystem my_embeds embedded
}
foo.localhost {
root * /foo
file_server {
fs embedded
fs my_embeds
}
}
bar.localhost {
root * /bar
file_server {
fs embedded
fs my_embeds
}
}
```