diff options
author | Francis Lavoie <lavofr@gmail.com> | 2020-05-26 17:27:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-26 15:27:51 -0600 |
commit | 8c5d00b2bc815c182e1a510be6dddc128949bf23 (patch) | |
tree | ad09755b3df1de68f885542a849533da5410121d /caddytest/integration/caddyfile_adapt | |
parent | aa20878887c592fd79bef2a9943b1013ead8bac2 (diff) |
httpcaddyfile: New `handle_path` directive (#3281)
* caddyconfig: WIP implementation of handle_path
* caddyconfig: Complete the implementation - h.NewRoute was key
* caddyconfig: Add handle_path integration test
* caddyhttp: Use the path matcher as-is, strip the trailing *, update test
Diffstat (limited to 'caddytest/integration/caddyfile_adapt')
-rw-r--r-- | caddytest/integration/caddyfile_adapt/handle_path.txt | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/caddytest/integration/caddyfile_adapt/handle_path.txt b/caddytest/integration/caddyfile_adapt/handle_path.txt new file mode 100644 index 0000000..7f40fcf --- /dev/null +++ b/caddytest/integration/caddyfile_adapt/handle_path.txt @@ -0,0 +1,52 @@ +:80
+handle_path /api/v1/* {
+ respond "API v1"
+}
+----------
+{
+ "apps": {
+ "http": {
+ "servers": {
+ "srv0": {
+ "listen": [
+ ":80"
+ ],
+ "routes": [
+ {
+ "match": [
+ {
+ "path": [
+ "/api/v1/*"
+ ]
+ }
+ ],
+ "handle": [
+ {
+ "handler": "subroute",
+ "routes": [
+ {
+ "handle": [
+ {
+ "handler": "rewrite",
+ "strip_path_prefix": "/api/v1"
+ }
+ ]
+ },
+ {
+ "handle": [
+ {
+ "body": "API v1",
+ "handler": "static_response"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ }
+}
\ No newline at end of file |