- Install the latest version of Serverless Framework (https://www.serverless.com/).
- Configure credentials for AWS to make them accessible by Serverless.
- Create your own public Github repository for all future backend work (you might call it how you would like). You will have 2 repos - 1 for frontend, 1 for backend till the end of course.
NOTE: You should create branch from master and work in branch (f.e. branch name - task-3) in BE (backend) and in FE (frontend) repositories.
NOTE: Don't forget to add dynamic product representation on FE side.
NOTE: This microservice needs to be created using Serverless Framework, AWS API Gateway, AWS Lambda.
Find the entire program architecture: here.
- Create a lambda function called
getProductsList
under the same Serverless config file (i.e.serverless.yaml
) of Product Service which will be triggered by the HTTP GET method. - The requested URL should be
/products
. - The response from the lambda should be a full array of products (mock data should be used - this mock data should be stored in Product Service).
- This endpoint should be integrated with Frontend app for PLP (Product List Page) representation.
- Create a lambda function called
getProductsById
under the same Serverless config file (i.e.serverless.yaml
) of Product Service which will be triggered by the HTTP GET method. - The requested URL should be
/products/{productId}
(whatproductId
is in your application is up to you - productName, UUID, etc.). - The response from the lambda should be 1 searched product from an array of products (mock data should be used - this mock data should be stored in Product Service).
- This endpoint is not needed to be integrated with Frontend right now.
- Commit all your work to separate branch (e.g.
task-3
from the latestmaster
) in your own repository. - Create a pull request to the
master
branch. - Submit the link to the pull request for crosscheck
Reviewers should verify the lambda functions by invoking them through provided URLs.
- Product Service Serverless config contains configuration for 2 lambda functions, API is not working at all, but YAML configuration is correct
- The
getProductsList
ORgetProductsById
lambda function returns a correct response (POINT1) - The
getProductsById
ANDgetProductsList
lambda functions return a correct response code (POINT2) - Your own Frontend application is integrated with Product Service (
/products
API) and products from Product Service are represented on Frontend. AND POINT1 and POINT2 are done.
- +5 - Async/await is used in lambda functions
- +5 - ES6 modules are used for Product Service implementation
- +4 - Custom Webpack/ESBuild/etc is manually configured for Product Service. Not applicable for preconfigured/built-in bundlers that come with templates, plugins, etc.
- +4 (All languages) - SWAGGER documentation is created for Product Service
- +4 (All languages) - Lambda handlers are covered by basic UNIT tests (NO infrastructure logic is needed to be covered)
- +4 (All languages) - Lambda handlers (
getProductsList
,getProductsById
) code is written not in 1 single module (file) and separated in codebase. - +4 (All languages) - Main error scenarios are handled by API ("Product not found" error).
The following should be present in PR's description field:
-
What was done?
Example:
Service is done, but FE is not working...
Additional scope - webpack, swagger, unit tests
-
Link to Product Service API - .....
-
Link to FE PR (YOUR OWN REPOSITORY) - ...
-
In case SWAGGER file is not provided - please provide product schema in PR description