-
Notifications
You must be signed in to change notification settings - Fork 6
Description
We want the API developer to easily config the lambda stubs. Our panacloudconfig.json should look like this:
{
"lambdas": {
"user": { "is_mock": true },
"addUser": { "is_mock": true }
},
"stages": ["prd", "dev"]
}
There are only two states of lambdas either we are using the mock lambdas (custom test data) or stub lambdas (custom business logic) for the real lambdas.
When the is_mock is true we will be using the mock_lambda and mock_lambda_layer. But the mock data will be in a separate directory editable_src/mockData. The types of this mockData will be in a directory testCollectionsTypes in the root, it will be updated by the update cli command. However, editable_src/mockData will not be updated by the cli but the developer will be responsible for maintaining and updating it. This editable_src/mockData will be used to create the mock server on the server-side and test the API on the client-side. When the mock lambdas are being deployed the editable_src/mockData directory will be copied to the mock_lambda_layer.
When the is_mock is false we will be using the editable_src/lambda_stubs and editable_src/lambdaLayers for real lambdas. The editable_src/mockData will not be used on the server-side but only on the client-side to test the APIs.