Skip to content

Commit

Permalink
docs: Add embedded filesystem declaration to --embed example (#204)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
camhux committed Sep 20, 2024
1 parent b72e330 commit 16f248e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
```
Expand Down

0 comments on commit 16f248e

Please sign in to comment.