From 16f248e6d13c6e3eb8c190d18ff49970bd3be1ec Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Fri, 20 Sep 2024 15:55:07 -0700 Subject: [PATCH] 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 --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d6cf0ef..de07a2c 100644 --- a/README.md +++ b/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 } } ```