Created
December 29, 2018 18:12
-
-
Save sakapun/8280ecff35acf97e36290e703679c6a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
from jinja2 import Environment, FileSystemLoader | |
def lambda_handler(event, context): | |
# TODO implement | |
get = requests.get("https://api.trello.com/1/lists/xxxx/cards?key=yyyy&token=zzzzz&fields=name") | |
items = json.loads(get.text) | |
env = Environment(loader=FileSystemLoader('./templates', encoding='utf8')) | |
tpl = env.get_template('index.html') | |
return { | |
'statusCode': 200, | |
'headers': {"content-type": "text/html; charset=utf-8"}, | |
'body': tpl.render({'items': items}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment