-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker-local): add local docker-compose configuration for quicks…
…tart (#46)
- Loading branch information
1 parent
ea51252
commit d443943
Showing
22 changed files
with
544 additions
and
222 deletions.
There are no files selected for viewing
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM public.ecr.aws/sam/build-provided.al2:latest | ||
|
||
WORKDIR /var/task | ||
|
||
COPY template.yaml . | ||
COPY go.mod . | ||
COPY go.sum . | ||
COPY lambda-handler ./lambda-handler | ||
COPY .aws-sam ./.aws-sam | ||
|
||
EXPOSE 3002 |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// This is a simple AWS Lambda function that returns a JSON response with a message "Hello World" | ||
// Used for integration testing with sam local and docker-compose | ||
package main | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
"fmt" | ||
|
||
"github.com/aws/aws-lambda-go/events" | ||
"github.com/aws/aws-lambda-go/lambda" | ||
) | ||
|
||
type Response struct { | ||
Message string `json:"message"` | ||
} | ||
|
||
func init() { | ||
} | ||
|
||
func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { | ||
|
||
response := Response{ | ||
Message: "Hello Wooooorld", | ||
} | ||
|
||
b, err := json.Marshal(response) | ||
if err != nil { | ||
fmt.Println(err) | ||
} | ||
|
||
|
||
return events.APIGatewayProxyResponse{ | ||
StatusCode: 200, | ||
Headers: map[string]string{ | ||
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally | ||
}, | ||
Body: string(b), | ||
}, nil | ||
} | ||
|
||
func main() { | ||
lambda.Start(handleRequest) | ||
} |
Oops, something went wrong.