Requirements

**npm install -g node-lambda**

These instructions ensure that you have the right environment for Lambdas development and deployment.

event.json file configuration

It is essential that you correctly prepare your event.json file. This file contains the event that will be simulated during the test of each service. Follow these steps to set it up properly:

File Structure: The event.json file must be in JSON format and reflect the data expected by the Lambda function you are going to test. Make sure the fields match the parameters required by your service.

Basic example of an event.json file:

{
  "httpMethod": "POST",  // Here we specify the HTTP method we need, such as POST or GET.
  "path": "/auth-service/service",  // We specify the path and the service to be consumed.
  "queryStringParameters": {  // We enter the parameters to be sent via the URL, if necessary.
    "parameter1": "value1",
    "parameter2": "value2"
  },
  "multiValueHeaders": {
    "x-forwarded-for": ["ip1", "ip2"],  // We specify the IPs that will be validated.
    "origin": "<https://example.com>"  // We enter the origin to validate if it matches the origin sent in the body.
  },
  "body": "encrypted_data_here",  // We include the encrypted data with the necessary information, depending on the service requested.
  "isBase64Encoded": false  // Indicates whether the body is Base64 encoded or not.
}

Encrypted data

Body