This is a simple repo that demo that shows how to write a serverless function in Python, based on this blog post by Michael Lavers. Check out the post for more information about the end-to-end setup and deployment.
You'll need Node, NPM, and Python installed to invoke these functions locally.
Additionally, you'll need to install the Serverless Framework globally.
npm install -g serverless
There are two functions included in this repo.
simple
returns a static string in JSON.
serverless invoke local --function simple
httprequest
makes an API call to the Dog Facts API, and returns 3 facts as JSON.
serverless invoke local --function httprequest
Check the Serverless docs for more information about running functions locally.