apisix.json•2.19 kB
[
{
"request": {
"main_sh": "curl -sI \"http://127.0.0.1:9080\" | grep Server",
"apisix_yaml": "routes:\n - id: 1\n uri: /*\n upstream:\n nodes:\n \"127.0.0.1:9001\": 1\n type: roundrobin\n#END"
},
"response": {
"text": "Server: APISIX/3.9.0"
}
},
{
"request": {
"main_sh": "curl -s \"http://127.0.0.1:9080/anything\"",
"apisix_yaml": "routes:\n - id: 1\n uri: /anything\n plugins:\n response-rewrite:\n body: '{\"message\":\"Hello from APISIX!\"}'\n headers:\n content-type: application/json\n upstream:\n nodes:\n \"httpbin.org:80\": 1\n type: roundrobin\n#END"
},
"response": {
"text": "{\"message\":\"Hello from APISIX!\"}"
}
},
{
"request": {
"main_sh": "curl -s \"http://127.0.0.1:9080/ip\"",
"apisix_yaml": "routes:\n - id: 1\n uri: /headers\n upstream:\n nodes:\n \"httpbin.org:80\": 1\n type: roundrobin\n#END"
},
"response": {
"text": "{\"error_msg\":\"404 Route Not Found\"}"
}
},
{
"request": {
"main_sh": "curl -s \"http://127.0.0.1:9080/non-existent-path\"",
"apisix_yaml": "routes:\n - id: 1\n uri: /specific-path\n upstream:\n nodes:\n \"httpbin.org:80\": 1\n type: roundrobin\n#END"
},
"response": {
"text": "{\"error_msg\":\"404 Route Not Found\"}"
}
},
{
"request": {
"main_sh": "curl -s \"http://127.0.0.1:9080/headers\"",
"apisix_yaml": "routes:\n - id: 1\n uri: /headers\n upstream:\n nodes:\n \"httpbin.org:80\": 1\n type: roundrobin\n#END"
},
"response": {
"text": "\"headers\":"
}
},
{
"request": {
"main_sh": "curl -s \"http://127.0.0.1:9080/ip\" -H \"apikey: secret-key\"",
"apisix_yaml": "consumers:\n - username: tom\n plugins:\n key-auth:\n key: secret-key\n\nroutes:\n - id: 1\n uri: /ip\n plugins:\n key-auth: {}\n upstream:\n nodes:\n \"httpbin.org:80\": 1\n type: roundrobin\n#END"
},
"response": {
"text": "\"origin\":"
}
}
]