{"repo":"Albert-Gao/micro-aws-lambda","free":true,"listed":false,"github":"https://github.com/Albert-Gao/micro-aws-lambda","clone":"git clone https://github.com/Albert-Gao/micro-aws-lambda.git","description":"A 7KB and 0 dependencies AWS Lambda library which supports middleware and easy debug.","language":"TypeScript","stars":186,"topics":["aws","lambda","middleware","aws-lambda","library","nodejs","typescript"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Micro AWS Lambda micro-aws-lambda is a small TypeScript middleware wrapper for AWS Lambda handlers behind API Gateway. It runs middleware functions one by one, stops on the first returned value or thrown error, and converts the result into an API Gateway-compatible HTTP response. Features - API Gateway proxy responses with JSON headers and CORS defaults. - Sequential middleware flow with early exit by return or throw . - A shared object for passing state between middleware functions in one request. - Response helpers for success, custom responses, and common HTTP errors. - Optional request logging and trace information in response bodies. - Zero runtime dependencies. Install Quick Start The value returned by the middleware becomes a 200 response. Object and array bodies are JSON stringified before the Lambda handler returns. API Gateway v1 and v2 The runtime path accepts both API Gateway REST API proxy events ( version: '1.0' , commonly called v1) and HTTP API proxy events ( version: '2.0' , commonly called v2). Trace information is generated differently for each event shape. The default Middleware type matches the REST API/Lambda Proxy handler returned by lambdas . You can also import MiddlewareLegacy for the same v1 event shape, or MiddlewareV2 when you are writing reusable middleware that reads HTTP API v2 event fields. For v2 HTTP API middleware, use MiddlewareV2 : Middleware Flow Each middleware receives { event, context, shared } . Flow rules: - Middleware functions run","default_branch":null,"files":null,"tree":[],"storefront":"/r/Albert-Gao","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Albert-Gao/micro-aws-lambda/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}