diff options
Diffstat (limited to 'tests/config-example/narchttpd.rhai')
-rw-r--r-- | tests/config-example/narchttpd.rhai | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/tests/config-example/narchttpd.rhai b/tests/config-example/narchttpd.rhai index c876bc1..7c9185d 100644 --- a/tests/config-example/narchttpd.rhai +++ b/tests/config-example/narchttpd.rhai @@ -1,17 +1,20 @@ http_ports = [1337]; https_ports = []; -domain(["domain.test", "alternate-domain.test"], serve_static(#{ +let sample = serve_static(#{ root: "./domain.test", -})); -domain("sub.domain.test", serve_static(#{ +}); +domains["domain.test"] = sample; +domains["alternate-domain.test"] = sample; +domains["sub.domain.test"] = serve_static(#{ root: "./sub.domain.test", -})); -domain("dynamic.test", proxy_child(#{ - command: |port| "python -m http.server " + port, +}); +domains["dynamic.test"] = proxy_child(#{ + command: "python -m http.server 6970", in_dir: "./dynamic.test", -})); -domain("function.test", |request| #{ + port: 6970, +}); +domains["function.test"] = |request| #{ status: 200, body: "OK", -}); +}; |