summaryrefslogtreecommitdiff
path: root/caddytest/integration/caddyfile_adapt/matcher_syntax.txt
diff options
context:
space:
mode:
Diffstat (limited to 'caddytest/integration/caddyfile_adapt/matcher_syntax.txt')
-rw-r--r--caddytest/integration/caddyfile_adapt/matcher_syntax.txt77
1 files changed, 77 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/matcher_syntax.txt b/caddytest/integration/caddyfile_adapt/matcher_syntax.txt
new file mode 100644
index 0000000..8cabc58
--- /dev/null
+++ b/caddytest/integration/caddyfile_adapt/matcher_syntax.txt
@@ -0,0 +1,77 @@
+:80 {
+ @matcher {
+ method GET
+ }
+ respond @matcher "get"
+
+ @matcher2 method POST
+ respond @matcher2 "post"
+
+ @matcher3 not method PUT
+ respond @matcher3 "not put"
+}
+----------
+{
+ "apps": {
+ "http": {
+ "servers": {
+ "srv0": {
+ "listen": [
+ ":80"
+ ],
+ "routes": [
+ {
+ "match": [
+ {
+ "method": [
+ "GET"
+ ]
+ }
+ ],
+ "handle": [
+ {
+ "body": "get",
+ "handler": "static_response"
+ }
+ ]
+ },
+ {
+ "match": [
+ {
+ "method": [
+ "POST"
+ ]
+ }
+ ],
+ "handle": [
+ {
+ "body": "post",
+ "handler": "static_response"
+ }
+ ]
+ },
+ {
+ "match": [
+ {
+ "not": [
+ {
+ "method": [
+ "PUT"
+ ]
+ }
+ ]
+ }
+ ],
+ "handle": [
+ {
+ "body": "not put",
+ "handler": "static_response"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ }
+} \ No newline at end of file