Skip to content

Feature/task 3#1

Open
Tati-Moon wants to merge 3 commits intomainfrom
feature/task-3
Open

Feature/task 3#1
Tati-Moon wants to merge 3 commits intomainfrom
feature/task-3

Conversation

@Tati-Moon
Copy link
Owner

@Tati-Moon Tati-Moon commented Jun 16, 2024

Task 3

Task: https://github.com/rolling-scopes-school/aws/blob/main/aws-developer/03_serverless_api/task.md

What was done?

  • Created two Lambda functions: getProductsList and getProductsById.
  • Integrated these functions with API Gateway.
  • Added CORS support.
  • Created Swagger documentation.
  • Added unit tests for Lambda functions.

img1

Additional scope

  • Swagger documentation: added openapi.yaml file.
  • Unit tests: created tests for getProductsList and getProductsById.
  • Code is separated into different modules for better maintainability.

How to run Swagger locally?

  1. Ensure you have the necessary dependencies installed:
    • npm install swagger-ui-express yamljs express --legacy-peer-deps
  2. Run the Swagger server:
    • npm run start-swagger

img2

Links

img3

Evaluation Criteria

  • 100/100

###Task 3.1

  • Lambda function getProductsList created under the same AWS CDK Stack file of Product Service.
  • Lambda function is triggered by the HTTP GET method.
  • The requested URL is /products.
  • The response from the lambda is a full array of products (mock data is used).
  • The endpoint is integrated with the Frontend app for PLP (Product List Page) representation.

###Task 3.2

  • Lambda function getProductsById created under the same AWS CDK Stack file of Product Service.
  • Lambda function is triggered by the HTTP GET method.
  • The requested URL is /products/{productId}.
  • The response from the lambda is 1 searched product from an array of products (mock data is used).
  • Proper error handling for "Product not found" scenario.

###Task 3.3

  • Work is committed to a separate branch (e.g., task-3) from the latest master in the repository.
  • A pull request to the master branch is created.
  • The link to the pull request is submitted to the Crosscheck page in RS App.

###Additional Scope (+30 points)

  • (+7.5 points) Swagger documentation is created for Product Service.
    The openapi.yaml file is added to the repository.
    Can be rendered by Swagger Editor.
  • (+7.5 points) Lambda handlers are covered by basic UNIT tests (no infrastructure logic needs to be covered).
    Tests for getProductsList and getProductsById are implemented.
  • (+7.5 points) Lambda handlers (getProductsList, getProductsById) code is written not in one single module (file) and is separated in the codebase.
    The code is modularized.
  • (+7.5 points) Main error scenarios are handled by the API.
    Proper error messages are returned for scenarios like "Product not found".

Copy link

@VoliaSi VoliaSi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me everything looks fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants