iamsteveholmes
11/05/2024, 5:37 PMfun main
and the application plugin in gradle uses the file name with that function in MANIFEST.MF. I can see in the generated project it is pointing application.mainClass at the file containing the AppLoader, ApiGateway function and Event Handler. For an AWS Lambda how does it know to call the AppLoader?s4nchez
11/05/2024, 6:36 PMAndrew O'Hara
11/06/2024, 4:28 AMLambdaHandler
, containing a handleRequest
function with the specific signature outlined here. Http4k comes with its own implementation of the LambdaHandler
, so following the instructions Ivan linked is good enough.
So if you do this, the Lambda runtime will load your jar and reflectively construct the class you passed into the config. Then it will invoke the handleRequest
function. No main function necessary.
To better understand how Lambda works, I suggest you try making a simple "hello world" python or javascript function, which is trivial to make in comparison to Java, and can even be done in Lambda's online editor. From there, you can try making a "hello world" function in java. If you can do that, you might be in a better position to understand how http4k fits itself into the Lambda.iamsteveholmes
11/06/2024, 4:58 PM