AWS Serverless Micro
Run Micro functions on AWS Lambda. A very thin layer for Micro functions that does two things:
- Reshape an API Gateway
event
object tohttp.IncomingMessage
- Marshall the returned
http.ServerResponse
to a Lambda Proxy object.
Inspired by awslabs/aws-serverless-express.
With Micro:
// The Micro function$ cat my-apijsmoduleexports = async 'Welcome to Micro' // Running with `micro`$ micro my-apijsmicro: Accepting connections on port 3000
With aws-serverless-micro:
// The Micro function$ cat my-apijsmoduleexports = async 'Welcome to Micro' // Wrapped in `aws-serverless-micro`$ cat lambdajsmoduleexports = handler: // Deploy `lambda.handler` with the tool of your choice
Install
$ yarn add aws-serverless-micro
$ npm install aws-serverless-micro
aws-serverless-micro targets Node.js v8.10 or higher as this is the version running on AWS Lambda.
Compatability
This libary is 100% compatible with the Micro API. The full Micro test suite is run against the library with 100% coverage.
- micro.send
- micro.sendError
- micro.createError
- micro.buffer
- micro.text
- micro.json
License
MIT