Skip to content

Instantly share code, notes, and snippets.

@sakapun
Created December 29, 2018 18:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sakapun/8280ecff35acf97e36290e703679c6a6 to your computer and use it in GitHub Desktop.
Save sakapun/8280ecff35acf97e36290e703679c6a6 to your computer and use it in GitHub Desktop.
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