github.com/avenga/couper@v1.12.2/server/testdata/endpoints/01_couper.hcl (about) 1 server "api" { 2 error_file = "./../integration/server_error.html" 3 4 api { 5 base_path = "/v1" 6 7 error_file = "./../integration/api_error.json" 8 9 endpoint "/" { 10 proxy { 11 url = "${env.COUPER_TEST_BACKEND_ADDR}/proxy" 12 backend = "proxy" 13 set_request_headers = { 14 x-inline = "test" 15 } 16 } 17 18 proxy "p2" { 19 url = "${env.COUPER_TEST_BACKEND_ADDR}/proxy" 20 backend = "proxy" 21 set_request_headers = { 22 x-inline = "test" 23 } 24 } 25 26 request "r1" { 27 url = "${env.COUPER_TEST_BACKEND_ADDR}/request" 28 backend = "request" 29 } 30 31 request "r2" { 32 url = "${env.COUPER_TEST_BACKEND_ADDR}/request" 33 backend = "request" 34 } 35 36 set_request_headers = { 37 x-ep-inline = "test" 38 } 39 40 response { 41 status = "${backend_responses.default.status}" # string type test 42 # 404 + 404 + 404 + 404 43 body = backend_responses.r1.status + backend_responses.default.status + backend_responses.r2.status + backend_responses.p2.status 44 } 45 } 46 } 47 } 48 49 definitions { 50 # backend origin within a definition block gets replaced with the integration test "anything" server. 51 backend "proxy" { 52 path = "/anything" 53 origin = env.COUPER_TEST_BACKEND_ADDR 54 set_request_headers = { 55 x-data = "proxy-test" 56 } 57 } 58 backend "request" { 59 path = "/anything" 60 origin = env.COUPER_TEST_BACKEND_ADDR 61 set_request_headers = { 62 x-data = "request-test" 63 } 64 } 65 }