Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork0
Default serverless middleware for some of our projects.
includable/serverless-middleware
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A helper for writing APIs using AWS Lambda functions.
- Dependency injection for easy unit testing.
- Pretty JSON error output, with status codes automatically determined based on error message.
- Easy access to query strings and JSON body properties.
- Serverless warmup plugin support.
- OpenTelemetry support and additional span attributes, for use withopentelemetry-lambda.
yarn add @includable/serverless-middleware
import{middleware,auth}from"@includable/serverless-middleware";constdependencies={// dependencies for the dependency injector};exportconstapp=async({ query, path, body},{ currentUser/* dependences */},)=>{// if `auth` is included in the second param of `middleware`, currentUser// will be an object in the form of `{ id, groups, email, ... }`// your business logic goes herereturn{success:true,text:"Hello, world!",};};exportconsthandler=middleware(app,[auth]).register(dependencies);
Out of the box this middleware setup supports theserverless-plugin-warmupserverless plugin.
Simply install the serverless plugin, no other changes to your code necessary.The middleware will automatically prevent code execution on warmup requests.
If an active OpenTelemetry span is detected, event and response properties will automatically be added.
Custom consulting sessions availabe for implementation support and feature development.
About
Default serverless middleware for some of our projects.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.