This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "request-callout", | |
"config": { | |
"callouts": [ | |
{ | |
"name": "c1", | |
"request": { | |
"url": "https://mocki.io/v1/3b51613b-a7e0-44bf-803a-35f6939e55f3", | |
"method": "GET" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "request-callout", | |
"config": { | |
"callouts": [ | |
{ | |
"name": "echo", | |
"cache": { | |
"bypass": false | |
}, | |
"depends_on": [], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
luarocks --verbose --tree /tmp/test install lua-cjson | |
------------------------------------------------------------------------------- | |
Current configuration: | |
------------------------------------------------------------------------------- | |
accept_unknown_fields = false | |
arch = "linux-aarch64" | |
cache = {} | |
cache_fail_timeout = 86400 | |
cache_timeout = 60 | |
check_certificates = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function run_file(filename, env) | |
local fd, err = io.open(filename) | |
if not fd then | |
return nil, err, "open" | |
end | |
local str, err = fd:read("*a") | |
fd:close() | |
if not str then | |
return nil, err, "open" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "request-callout", | |
"config": { | |
"callouts": [ | |
{ | |
"name": "callout1", | |
"request": { | |
"url": "http://httpbin.org/anything", | |
"by_lua": "kong.ctx.shared.callouts.callout1.caching.cache_key = kong.request.get_header('cache-key')" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "request-callout", | |
"config": { | |
"callouts": [ | |
{ | |
"name": "c1", | |
"request": { | |
"url": "http://httpbin.org/uuid", | |
"method": "GET" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "request-callout", | |
"config": { | |
"callouts": [ | |
{ | |
"name": "callout1", | |
"request": { | |
"url": "http://httpbin.org/anything", | |
"method": "GET" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "request-callout", | |
"config": { | |
"callouts": [ | |
{ | |
"name": "callout1", | |
"request": { | |
"url": "http://httpbin.org/anything", | |
"by_lua": "local body = kong.request.get_body() or {}; local id = body.id; if id then kong.ctx.shared.callouts.callout1.request.params.url = 'http://httpbin.org/anything/' .. id end", | |
"method": "GET" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "request-callout", | |
"config": { | |
"callouts": [ | |
{ | |
"name": "callout1", | |
"request": { | |
"url": "http://httpbin.org/anything", | |
"method": "GET", | |
"query": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
events{} | |
http { | |
server { | |
listen 10000 http2; | |
location / { | |
grpc_pass_header Server; |
NewerOlder