Create a reactive, message-driven, asynchronous User Microservice with
PUT CRUD operations in a single AWS Lambda Function using the Serverless Framework
Serverless stack definition:
Use Vert.x's Event Bus to handle dynamic routing to event handlers based on HTTP method and resource path from the API input.
14-19 initializes the Vert.x instance. AWS Lambda will hold on to this instance for the life of the container/JVM. It is reused in subsequent requests.
17 registers the User Service handlers
22 defines the main handler method that is called when the Lambda function is invoked.
27 sends the Lambda function input to the (dynamic) address where handlers are waiting to respond.
44-66 defines the specific handlers and binds them to the appropriate channels (http method + resource path)
Serverless + Vert.x = BLISS