I am modelling my API after this tutorial, using serverless-http with expressJS and serverless-offline for local development. Inside an express route, I need to be able to access the event’s requestContext for authentication information. I can see the requestContext is available and the serverless-http plugin is providing some pieces of that context to the request object, but I cannot figure out how to access the identity and authorizor properties of the object from inside an express route.
I figured this out thanks to an answer in another forum and reading the docs more closely. In case anyone else comes across this later there is the solution:
In your main handler, you can provide a function that modifies the request object and has the event context provided.