andyg
08/11/2021, 8:19 AMmain()
when the entry point is class HelloServerlessHttp4k : ApiGatewayV1LambdaFunction(http4kApp)
. Also, how to import the LambdaHttpClient
? thank yous4nchez
08/11/2021, 8:40 AMHttpHandler
you can simply create a main
with http4App.asServer(...).start()
. Would that be enough or do you need lambda-specific things running locally?LambdaHttpClient
was intended to our internal integration tests, mainly, that's why it's in the test
source directory. What's your use case for it?
We could move it (although I'd probably consider a new module http4k-client-lambda
to keep the http4k-serverless-lambda
small)dave
08/11/2021, 8:51 AMandyg
08/11/2021, 9:30 AMhttp4App.asServer(...).start()
. Works fine on a basic server. But if I convert to Lambda, the API Gateway sends its own custom JSON payload (https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html). My understanding was the ApiGatewayV2LambdaFunction
converts that payload back into a "normal" request that http4k can handle with a normal route.dave
08/11/2021, 10:16 AMandyg
08/11/2021, 4:30 PMdave
08/11/2021, 4:31 PMandyg
08/16/2021, 11:54 AMmyRoutes.asServer(Undertow(8080)).start()
inside a main() method, while on Lambda I use a class defined with ApiGatewayV2LambdaFunction(myRoutes)
and that's all I needed to accept and respond to HTTP requests. Very cool! (and that's what I get for moving a complex app on my first try instead of a hello-world)