This util allows for mapping any HttpServletRequest and HttpServletResponse to and from API gateway classes
Add Jitpack to repos in gradle.build.kts
repositories { maven { url = uri("https://jitpack.io") } }Add dependency
dependencies { compile("com.github.richarddd:aws-lambda-api-gateway-servlet:master-SNAPSHOT") }
Example with javalin and aws lambda handler:
classHelloHandler : RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {
companionobject{
val app =Javalin.createStandalone()
app.get("/") { ctx -> ctx.result("Hello World") }
}
overridefunhandleRequest(input:APIGatewayProxyRequestEvent, context:Context) = app.servlet().serve(input)
}