Next, we need to wire up our API endpoints to Lambda and our handler.py entry point. This wiring looks like this in a serverless.yml configuration file:
functions: HandleSession: handler: handler.session events: - http: path: session method: get cors: true - http: path: session method: post cors: true HandleSessionDetail: handler: handler.session_detail events: - http: path: session/{id} method: get cors: true request: parameters: paths: id: true - http: path: session/{id} method: delete cors: true request: parameters: paths: id: true
We define two Lambda functions that have different configuration options, HandleSession and HandleSessionDetail.
Under each function's name, there are multiple statements ...