Skip to content

sizeko-devteam/awslambda-interface

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

awslambda-interface

0.1.5

modules

  • sendResponse
  • runAPIEndpoint

runAPIEndpoint()

# API lambda function
const { runAPIEndpoint } = require("@sizeko/awslambda-interface");
const _ENVJSON = require('./env.json');
const apiResponse = await runAPIEndpoint({
  ENVJSON: _ENVJSON,            // API definition file (./env.json) required
  event: event,                 // event from AWS Lambda called by API Gateway
  context: context,             // context from AWS Lambda called by API Gateway
  protocol: ['http','https']
});
return apiResponse;

env.json

API lambda function needs API definition file.

# Example
{
  "SERVICE_NAME": "sizeko",
  "REQUEST_MAPPER": [
    {
      "path": "/",                        // event.path
      "httpMethod": "GET",                // event.httpMethod
      "handler": "get-size"               // name of lambda function to handle this request
    },
    {
      "path": "/",
      "httpMethod": "POST",
      "handler": "update-size",
      "dataKeyStructure": "update.size"   // JsonPath expression shows JSON key structures of event.body in case of POST request
    }
  ]
}

0.1.0

modules

  • sendResponse
  • isServicePath
  • runServiceByURLPath
  • processMultiValueQueryParam
  • isAvailableRequestStructure
  • runServiceByPostKeys

0.0.1

Init the package and publish to public.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published