You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: java/http-proxy-apigateway/README.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,14 +12,15 @@
12
12
<!--END STABILITY BANNER-->
13
13
14
14
This example creates an API Gateway with proxy resources for 2 HTTP backends.
15
-
More HTTP backend APIs can be easily added.
16
15
This is useful for scenarios when incoming requests must be routed to one or more backend API hosts.
17
-
An HTTP proxy integration enables direct interactions between clients and backends without any intervention from API Gateway after the API method is set up.
16
+
An HTTP proxy integration enables direct interactions between clients and backends without any intervention from the API Gateway after the API method is set up.
18
17
19
18
> For more information on using HTTP proxy integrations with the APIGateway check out this [AWS tutorial](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-api-as-simple-proxy-for-http.html).
20
19
21
-
> For demonstration purposes this CDK example deploys a solution that routes to the [PetsStore API](http://petstore-demo-endpoint.execute-api.com/) (from this [AWS tutorial](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-api-as-simple-proxy-for-http.html)) and to the [OpenTrivia API](https://opentdb.com).
22
-
> If you prefer to use your own HTTP backend APIs modify the argument used to call the [`HttpProxyApiGatewayStack`](src/main/java/com/myorg/HttpProxyApiGatewayStack.java) constructor in the [`HttpProxyApiGatewayApp`](src/main/java/com/myorg/HttpProxyApiGatewayApp.java) class.
20
+
> For demonstration purposes this CDK example deploys a solution that routes to a couple of test HTTP APIs.
21
+
> The 2 test HTTP APIs are implemented using lambdas exposed through function URLs.
22
+
> This example can be modified though, if you prefer to use your own HTTP backend APIs.
23
+
> To do that you can modify the `createHTTPTestAPIs` method in the [`HttpProxyApiGatewayStack`](src/main/java/com/myorg/HttpProxyApiGatewayStack.java) class to return a list of `ProxyResourceParameters` corresponding to your own resources.
23
24
24
25
## Build
25
26
@@ -37,12 +38,13 @@ This will install the necessary CDK, then this example's dependencies, and then
37
38
38
39
Run `cdk deploy`.
39
40
This will deploy / redeploy the Stack to AWS.
40
-
After the CDK deployment is successful, 2 URL examples will be available in the terminal console output:
41
+
After the CDK deployment is successful, 2 URL examples will be available in the terminal console:
41
42
42
-
- One for the `PetStoreProxyEndPointGetRequestExample` stack output
43
-
- One for the `OpenTriviaProxyEndPointGetRequestExample` stack output
43
+
- One for the `HttpProxyApiGatewayStack.HelloFunctionResourceExample` output
44
+
- One for the `HttpProxyApiGatewayStack.ByeFunctionResourceExample` output
44
45
45
46
At this point, you can copy each of the 2 URLs and paste them in the address bar of a browser to invoke the 2 APIs.
47
+
Also note that both URLs have the same host (the DNS of the new API Gateway created).
0 commit comments