Skip to content
Run any Java Http framework (with servlet support) in AWS Lambda
Kotlin
Branch: master
Clone or download
Latest commit 3cb3b4d Aug 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea Init commit Aug 8, 2019
gradle/wrapper Init commit Aug 8, 2019
src Init commit Aug 8, 2019
.gitignore Init commit Aug 8, 2019
LICENSE Initial commit Aug 8, 2019
README.md Update README.md Aug 8, 2019
build.gradle.kts Init commit Aug 8, 2019
gradlew Init commit Aug 8, 2019
gradlew.bat Init commit Aug 8, 2019
settings.gradle.kts Init commit Aug 8, 2019

README.md

AWS Lambda API Gateway Servlet

This util allows for mapping any HttpServletRequest and HttpServletResponse to and from API gateway classes

Installation

  1. Add Jitpack to repos in gradle.build.kts

    repositories {
       maven {
           url = uri("https://jitpack.io")
       }
    }
  2. Add dependency

    dependencies {
        compile("com.github.richarddd:aws-lambda-api-gateway-servlet:master-SNAPSHOT")
    }

Usage

Example with javalin and aws lambda handler:

class HelloHandler : RequestHandler<APIGatewayProxyRequestEvent, APIGatewayProxyResponseEvent> {

    companion object{
        val app = Javalin.createStandalone()
        app.get("/") { ctx -> ctx.result("Hello World") }
    }

    override fun handleRequest(input: APIGatewayProxyRequestEvent, context: Context) = app.servlet().serve(input)
}
You can’t perform that action at this time.