A wrapper around Open API with logging and error handling.
Install the library.
yarn add @alphatango/openapi
import { OpenApiWrapper } from '@alphatango/openapi';
const { api, getUserPrincipal, getRequestId, getUserToken } = new OpenApiWrapper(requestLogger);
api.get('/livecheck', () => {
statusCode: 200;
});
api.any('/{proxy+}', () => {
statusCode: 404;
});
export const lambdaHandler = api.handler;
We value your input as part of direct feedback to us, by filing issues, or preferably by directly contributing improvements:
- Fork this repository
- Create a branch
- Contribute
- Pull request