mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-02 13:59:50 +08:00
77 lines
1.0 KiB
Plaintext
77 lines
1.0 KiB
Plaintext
|
: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"
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|