@lamware/sst
v1.0.0
Published
Lamware Middleware to enable SST runtime
Downloads
46
Readme
This Lamware Middleware wraps your Lambda Function using the SST API Handler, allowing the SST runtime hooks to work with their dependency injection.
Installation
This package is available via NPM:
yarn add @lamware/sst
# or
npm install @lamware/sst
Usage
import type { APIGatewayProxyHandlerV2 } from 'aws-lambda';
import { useJsonBody } from 'sst/node/api';
import { lamware } from '@lamware/core';
import { sst } from '@lamware/sst';
const { handler } = lamware<APIGatewayProxyHandlerV2>()
.use(sst())
.execute(async () => {
const json = useJsonBody();
return { statusCode: 200 };
});
export { handler };