Multi-file application - json
- Create a file called a.json with some JSON content in it.
examples/aws/a.json
{ "name" : "Apple" }
- Change the code to read the file and return it
examples/aws/read_json.py
import json def lambda_handler(event, context): with open('a.json') as fh: data = json.load(fh) return { 'statusCode': 200, 'headers': { 'Content-Type': 'application/json' }, 'body': json.dumps({ 'data' : data }) }