Skip to content

Instantly share code, notes, and snippets.

@nikita-petko
Last active January 24, 2023 22:03
Show Gist options
  • Select an option

  • Save nikita-petko/32b6535689bd07b7c24c99bca22ce479 to your computer and use it in GitHub Desktop.

Select an option

Save nikita-petko/32b6535689bd07b7c24c99bca22ce479 to your computer and use it in GitHub Desktop.
- routeTemplate: /testing/(?<extra>.+)
hostname: "*"
statusCode: 200
method: "*"
templateVariables:
clientIpExpr: "{{query.noIp | setVarBatchConditional clientIp string ${value_} ne true then ${ip_}; _ _ _ default [value not shown]}}"
body:
{
"message": "test response!",
"tip": "set __debug_response to view raw yaml rule. set query.noIp to mask your IP address",
"client": "{{header['x-forwarded-for']}}",
"extraPath": "/{{path.extra}}",
"machineId": "{{var.machineId_}}"
}
formatBody: true
headers:
Content-Type: application/json
weight: 50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment