A set of helper classes and utilities for working with serverless and java
0.1 (current) - Simple POJOs and minor helpers to make working with lambda-proxy mode of serverless easier with java
To add this library to your project, first add the repo:
repositories {
maven { url 'https://github.com/bonespike/mvn-repo/raw/master/maven-deploy' }
// ...
}
And then you can the artifact like this:
dependencies {
compile 'com.bonespike:serverless-java-util:0.1'
// ...
}
Define your serverless function as usual, but set the handler signature so that the input and outputs are:
com.bonespike.sju.ApiGatewayRequest and com.bonespike.sju.ApiGatewayResponse
public class Handler implements RequestHandler<ApiGatewayRequest, ApiGatewayResponse> {
public ApiGatewayResponse handleRequest(ApiGatewayRequest input, Context context) {
String body = input.getBody();
ApiGatewayResponse response = new ApiGatewayResponse();
response.setBody("{'response': 'all good'}");
return response;
}
}