Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task 3 #119

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Task 3 #119

wants to merge 2 commits into from

Conversation

Tati-Moon
Copy link

@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.

Store Application

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

Local Swagger

Links

App

#Evaluation Criteria
[x] 100/100

###Task 3.1

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

###Task 3.2

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

###Task 3.3

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

###Additional Scope (+30 points)

  • [x](+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.
  • [x](+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.
  • [x](+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.
  • [x](+7.5 points) Main error scenarios are handled by the API.
    Proper error messages are returned for scenarios like "Product not found".

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.

1 participant