mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-29 07:03:48 +03:00
77 lines
1 KiB
Text
77 lines
1 KiB
Text
|
: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"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|