Shari λ
Helper framework to get you up and running and consuming Shari SNS events.
All you have to do is register the event you want to listen to and the class which will handle it. As long as this class returns a Promise, you're all set.
index.js
'use strict'; var ShariLambda = ;var MyHandler = ; // Register the event and how to handle to Shari LambdaShariLambdaEventHandlerRegistry; // Export the Shari Lambda handler to AWS Lambdaexportshandle = ShariLambdahandle;
my_handler.js
{ return Promise; }moduleexports = MyHandler;
config.js
'use strict'; { return processenvENVIRONMENT || 'development';} moduleexportsConfig = environmentName: environmentName { return ''; } honeybadger: apiKey: '' server: environment_name: logger: console developmentEnvironments: 'development' 'dev' 'test'
If you want a default handler to handle all events you can do so:
'use strict'; var ShariLambda = ;var BookingEventHandler = ; ShariLambdaEventHandlerRegistry; exportshandle = ShariLambdahandle;
Features
- Heartbeat
- Honeybadger failure
- Async with Promises