Created
June 10, 2018 15:52
-
-
Save juancho088/891ef5a1b274e32ca9c06af3d2b60368 to your computer and use it in GitHub Desktop.
Default Handler that Serverless Framework creates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.amazonaws.services.lambda.runtime.Context | |
import com.amazonaws.services.lambda.runtime.RequestHandler | |
import org.apache.logging.log4j.LogManager | |
class Handler:RequestHandler<Map<String, Any>, ApiGatewayResponse> { | |
override fun handleRequest(input:Map<String, Any>, context:Context):ApiGatewayResponse { | |
LOG.info("received: " + input.keys.toString()) | |
return ApiGatewayResponse.build { | |
statusCode = 200 | |
objectBody = HelloResponse("Go Serverless v1.x! Your Kotlin function executed successfully!", input) | |
headers = mapOf("X-Powered-By" to "AWS Lambda & serverless") | |
} | |
} | |
companion object { | |
private val LOG = LogManager.getLogger(Handler::class.java) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment