mirror of
https://github.com/caddyserver/xcaddy.git
synced 2025-01-22 08:36:28 +01:00
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:
parent
b72e330d5d
commit
16f248e6d1
1 changed files with 10 additions and 3 deletions
13
README.md
13
README.md
|
@ -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
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue