diff --git a/README.md b/README.md index a2f9fd4..3176fa9 100644 --- a/README.md +++ b/README.md @@ -450,7 +450,7 @@ Now that the setup is done you can deploy to AWS. POST ```shell - $ curl --location --request POST 'https://lmk0qo0xrl.execute-api.ap-southeast-2.amazonaws.com/dev/' \ + $ curl --location --request POST 'https://{apiid}.execute-api.ap-southeast-2.amazonaws.com/dev/' \ --header 'Content-Type: application/json' \ --data-raw '{ "env": "production", @@ -467,14 +467,7 @@ POST GET ```shell - curl --location --request POST 'http://localhost:8080' \ - --header 'Content-Type: application/json' \ - --data-raw '{ - "httpMethod": "GET", - "pathParameters": { - "proxy": "production-1234-someapp" - } - }' + curl --request GET 'https://{apiid}.execute-api.ap-southeast-2.amazonaws.com/dev/production-1234-someapp' ``` 3. Et voila! It runs with 500 ms for cold start. diff --git a/spring-native-aws-service/src/main/java/com/coffeebeans/springnativeawslambda/ReflectionRuntimeHints.java b/spring-native-aws-service/src/main/java/com/coffeebeans/springnativeawslambda/ReflectionRuntimeHints.java index ceeeb72..b9e3771 100644 --- a/spring-native-aws-service/src/main/java/com/coffeebeans/springnativeawslambda/ReflectionRuntimeHints.java +++ b/spring-native-aws-service/src/main/java/com/coffeebeans/springnativeawslambda/ReflectionRuntimeHints.java @@ -18,7 +18,6 @@ package com.coffeebeans.springnativeawslambda; -import java.util.List; import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent; import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyResponseEvent; import com.coffeebeans.springnativeawslambda.model.Secret; @@ -29,18 +28,21 @@ import org.springframework.aot.hint.TypeReference; import org.springframework.lang.Nullable; +import java.util.List; + public class ReflectionRuntimeHints implements RuntimeHintsRegistrar { - @Override - public void registerHints(final RuntimeHints hints, @Nullable final ClassLoader classLoader) { - final List typeReferences = List.of( - TypeReference.of(DateTime.class), - TypeReference.of(Secret.class), - TypeReference.of(APIGatewayProxyResponseEvent.class), - TypeReference.of(APIGatewayProxyRequestEvent.class), - TypeReference.of(APIGatewayProxyRequestEvent.ProxyRequestContext.class) - ); + @Override + public void registerHints(final RuntimeHints hints, @Nullable final ClassLoader classLoader) { + final List typeReferences = List.of( + TypeReference.of(DateTime.class), + TypeReference.of(Secret.class), + TypeReference.of(APIGatewayProxyResponseEvent.class), + TypeReference.of(APIGatewayProxyRequestEvent.class), + TypeReference.of(APIGatewayProxyRequestEvent.ProxyRequestContext.class), + TypeReference.of(APIGatewayProxyRequestEvent.RequestIdentity.class) + ); - hints.reflection().registerTypes(typeReferences, builder -> builder.withMembers(MemberCategory.values())); - } + hints.reflection().registerTypes(typeReferences, builder -> builder.withMembers(MemberCategory.values())); + } }