Browse Source
* httpcaddyfile: Add `{vars.*}` placeholder shortcut I'm yoinking this from my https://github.com/caddyserver/caddy/pull/4657 PR because I think we should get this in ASAP for v2.5.0 along with the new `vars` directive. * Sort vars by matchers in reversemaster
Francis Lavoie
3 years ago
committed by
GitHub
3 changed files with 82 additions and 7 deletions
@ -0,0 +1,59 @@ |
|||||
|
:80 |
||||
|
|
||||
|
vars /foobar foo last |
||||
|
vars /foo foo middle |
||||
|
vars * foo first |
||||
|
---------- |
||||
|
{ |
||||
|
"apps": { |
||||
|
"http": { |
||||
|
"servers": { |
||||
|
"srv0": { |
||||
|
"listen": [ |
||||
|
":80" |
||||
|
], |
||||
|
"routes": [ |
||||
|
{ |
||||
|
"handle": [ |
||||
|
{ |
||||
|
"foo": "first", |
||||
|
"handler": "vars" |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
"match": [ |
||||
|
{ |
||||
|
"path": [ |
||||
|
"/foo" |
||||
|
] |
||||
|
} |
||||
|
], |
||||
|
"handle": [ |
||||
|
{ |
||||
|
"foo": "middle", |
||||
|
"handler": "vars" |
||||
|
} |
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
"match": [ |
||||
|
{ |
||||
|
"path": [ |
||||
|
"/foobar" |
||||
|
] |
||||
|
} |
||||
|
], |
||||
|
"handle": [ |
||||
|
{ |
||||
|
"foo": "last", |
||||
|
"handler": "vars" |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue