This project is a serverless CRUD application built using AWS Lambda and DynamoDB. It provides a simple API for managing user data using API Gateway , DynamoDB , Lambda Comlpete serveless stack.
This project is a serverless CRUD application built using AWS Lambda and DynamoDB. It provides a simple API for managing user data.
-
Clone the repository:
git clone https://github.com/Reaper1994/go-serverless-app.git cd go-serverless-app
-
Set up your Go environment and install dependencies.
go run cmd/main.go
The application exposes the following API endpoints:
- GET https://localhost:8000 : Retrieve a list of users.
- POST https://localhost:8000: Create a new user.
- PUT https://localhost:8000/{id}: Update an existing user.
- DELETE https://localhost:8000/{id}: Delete a user.
The application uses middleware for logging and monitoring. The TreblleMiddleware
is included to track API requests and responses.
The following environment variables are required:
TREBLLE_API_KEY
: Your Treblle API key for monitoring.TREBLLE_PROJECT_ID
: Your Treblle project ID.AWS_REGION
: The AWS region where your DynamoDB is hosted. // auto setup by AWS
-
Install dependencies:
go get ./...
-
Run the application:
go run cmd/main.go
-
Test the endpoints using a tool like Postman or curl.
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for details.