Skip to content

Commit 98df1c4

Browse files
committed
add build.gradle and some code
1 parent 5a310d7 commit 98df1c4

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

build.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
apply plugin: 'java'
2+
3+
repositories {
4+
mavenCentral()
5+
}
6+
7+
dependencies {
8+
compile(
9+
'com.amazonaws:aws-lambda-java-core:1.1.0',
10+
'com.amazonaws:aws-lambda-java-events:1.1.0'
11+
)
12+
}
13+
14+
task buildZip(type: Zip) {
15+
baseName = 'java4lambda'
16+
from compileJava
17+
from processResources
18+
into('lib') {
19+
from configurations.runtime
20+
}
21+
}
22+
23+
build.dependsOn buildZip

main/java/cwt/lambda/Hello.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package cwt.lambda;
2+
3+
import com.amazonaws.services.lambda.runtime.Context;
4+
import com.amazonaws.services.lambda.runtime.RequestHandler;
5+
6+
/**
7+
* Basic string input, string output.
8+
* <p>
9+
* http://docs.aws.amazon.com/lambda/latest/dg/java-programming-model-req-resp.html
10+
*/
11+
public class Hello implements RequestHandler<String, String> {
12+
@Override
13+
public String handleRequest(String input, Context context) {
14+
return String.format("Hello %s.", input);
15+
}
16+
}

0 commit comments

Comments
 (0)