diff --git a/.gitignore b/.gitignore
index dca9d31..c5cc947 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,5 @@
java/target/
apis.txt
+*.iml
+*.ipr
diff --git a/deploy.sh b/deploy.sh
index 9181d1b..5dcc973 100644
--- a/deploy.sh
+++ b/deploy.sh
@@ -1,18 +1,19 @@
-#!/bin/bash
-declare -a folders=("csharp" "csharp2" "fsharp" "fsharp2" "go" "java" "python" "python3" "nodejs4" "nodejs6")
-
-export AWS_PROFILE=personal
-
-for i in `seq 1 10`;
-do
- for folder in "${folders[@]}"
- do
- cd $folder
- pwd
-
- sls deploy --region ap-southeast-2
-
- cd ..
- done
-
-done
\ No newline at end of file
+#!/bin/bash
+declare -a folders=("csharp" "csharp2" "fsharp" "fsharp2" "go" "java" "python" "python3" "nodejs4" "nodejs6", "python-go")
+
+export AWS_PROFILE=default
+export AWS_REGION=us-east-1
+
+for i in `seq 1 11`;
+do
+ for folder in "${folders[@]}"
+ do
+ cd $folder
+ pwd
+
+ sls deploy --region $AWS_REGION
+
+ cd ..
+ done
+
+done
diff --git a/fsharp/Handler.fs b/fsharp/Handler.fs
index cc14f25..3657ed7 100755
--- a/fsharp/Handler.fs
+++ b/fsharp/Handler.fs
@@ -6,10 +6,6 @@ open Amazon.Lambda.Core
do ()
module Handler =
- open System
- open System.IO
- open System.Text
-
type Response = { statusCode : int; body : string }
let hello(): Response = {
diff --git a/fsharp2/Handler.fs b/fsharp2/Handler.fs
index cc14f25..3657ed7 100644
--- a/fsharp2/Handler.fs
+++ b/fsharp2/Handler.fs
@@ -6,10 +6,6 @@ open Amazon.Lambda.Core
do ()
module Handler =
- open System
- open System.IO
- open System.Text
-
type Response = { statusCode : int; body : string }
let hello(): Response = {
diff --git a/go/Makefile b/go/Makefile
index 1c23aaa..6c7d24b 100644
--- a/go/Makefile
+++ b/go/Makefile
@@ -1,4 +1,7 @@
build:
go get github.com/aws/aws-lambda-go/lambda
go get github.com/aws/aws-lambda-go/events
- env GOOS=linux go build -o bin/main
\ No newline at end of file
+ env GOOS=linux go build -ldflags='-w -s' -o bin/main
+
+compress:
+ upx --brute bin/main
\ No newline at end of file
diff --git a/go/main.go b/go/main.go
index 84b6f58..ae30fbf 100644
--- a/go/main.go
+++ b/go/main.go
@@ -7,8 +7,8 @@ import (
"github.com/aws/aws-lambda-go/lambda"
)
-func Handler(ctx context.Context, request *events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
- return events.APIGatewayProxyResponse{Body: "hello", StatusCode: 200}, nil
+func Handler(ctx context.Context, request *events.APIGatewayProxyRequest) (*events.APIGatewayProxyResponse, error) {
+ return &events.APIGatewayProxyResponse{Body: "hello", StatusCode: 200}, nil
}
func main() {
diff --git a/java/hello.iml b/java/hello.iml
deleted file mode 100644
index 928d292..0000000
--- a/java/hello.iml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/java/pom.xml b/java/pom.xml
index 4bafb38..cea594c 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -19,26 +19,6 @@
aws-lambda-java-core
1.1.0
-
- com.amazonaws
- aws-lambda-java-log4j
- 1.0.0
-
-
- com.fasterxml.jackson.core
- jackson-core
- 2.8.5
-
-
- com.fasterxml.jackson.core
- jackson-databind
- 2.8.5
-
-
- com.fasterxml.jackson.core
- jackson-annotations
- 2.8.5
-
diff --git a/java/src/main/java/com/serverless/ApiGatewayResponse.java b/java/src/main/java/com/serverless/ApiGatewayResponse.java
deleted file mode 100644
index cb25c5d..0000000
--- a/java/src/main/java/com/serverless/ApiGatewayResponse.java
+++ /dev/null
@@ -1,129 +0,0 @@
-package com.serverless;
-
-import java.nio.charset.StandardCharsets;
-import java.util.Base64;
-import java.util.Collections;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class ApiGatewayResponse {
-
- private final int statusCode;
- private final String body;
- private final Map headers;
- private final boolean isBase64Encoded;
-
- public ApiGatewayResponse(int statusCode, String body, Map headers, boolean isBase64Encoded) {
- this.statusCode = statusCode;
- this.body = body;
- this.headers = headers;
- this.isBase64Encoded = isBase64Encoded;
- }
-
- public int getStatusCode() {
- return statusCode;
- }
-
- public String getBody() {
- return body;
- }
-
- public Map getHeaders() {
- return headers;
- }
-
- // API Gateway expects the property to be called "isBase64Encoded" => isIs
- public boolean isIsBase64Encoded() {
- return isBase64Encoded;
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
-
- private static final Logger LOG = Logger.getLogger(ApiGatewayResponse.Builder.class);
-
- private static final ObjectMapper objectMapper = new ObjectMapper();
-
- private int statusCode = 200;
- private Map headers = Collections.emptyMap();
- private String rawBody;
- private Object objectBody;
- private byte[] binaryBody;
- private boolean base64Encoded;
-
- public Builder setStatusCode(int statusCode) {
- this.statusCode = statusCode;
- return this;
- }
-
- public Builder setHeaders(Map headers) {
- this.headers = headers;
- return this;
- }
-
- /**
- * Builds the {@link ApiGatewayResponse} using the passed raw body string.
- */
- public Builder setRawBody(String rawBody) {
- this.rawBody = rawBody;
- return this;
- }
-
- /**
- * Builds the {@link ApiGatewayResponse} using the passed object body
- * converted to JSON.
- */
- public Builder setObjectBody(Object objectBody) {
- this.objectBody = objectBody;
- return this;
- }
-
- /**
- * Builds the {@link ApiGatewayResponse} using the passed binary body
- * encoded as base64. {@link #setBase64Encoded(boolean)
- * setBase64Encoded(true)} will be in invoked automatically.
- */
- public Builder setBinaryBody(byte[] binaryBody) {
- this.binaryBody = binaryBody;
- setBase64Encoded(true);
- return this;
- }
-
- /**
- * A binary or rather a base64encoded responses requires
- *
- * - "Binary Media Types" to be configured in API Gateway
- *
- a request with an "Accept" header set to one of the "Binary Media
- * Types"
- *
- */
- public Builder setBase64Encoded(boolean base64Encoded) {
- this.base64Encoded = base64Encoded;
- return this;
- }
-
- public ApiGatewayResponse build() {
- String body = null;
- if (rawBody != null) {
- body = rawBody;
- } else if (objectBody != null) {
- try {
- body = objectMapper.writeValueAsString(objectBody);
- } catch (JsonProcessingException e) {
- LOG.error("failed to serialize object", e);
- throw new RuntimeException(e);
- }
- } else if (binaryBody != null) {
- body = new String(Base64.getEncoder().encode(binaryBody), StandardCharsets.UTF_8);
- }
- return new ApiGatewayResponse(statusCode, body, headers, base64Encoded);
- }
- }
-}
diff --git a/java/src/main/java/com/serverless/Handler.java b/java/src/main/java/com/serverless/Handler.java
index 114ef69..904a086 100644
--- a/java/src/main/java/com/serverless/Handler.java
+++ b/java/src/main/java/com/serverless/Handler.java
@@ -1,17 +1,14 @@
package com.serverless;
-import java.util.Map;
-
import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;
-public class Handler implements RequestHandler