Browse Source
* 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 testmaster
Francis Lavoie
5 years ago
committed by
GitHub
4 changed files with 186 additions and 59 deletions
@ -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" |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|||
} |
|||
} |
|||
} |
|||
} |
Loading…
Reference in new issue