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
| <!DOCTYPE html> | |
| <html lang="en-US"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <script> | |
| async function fetchSandwich() { | |
| let apiUrl = 'https://***.execute-api.us-east-2.amazonaws.com/default/lambda_tutorial' | |
| let response = await fetch(apiUrl); | |
| let body = await response.json(); | |
| document.getElementById('sandwich-result').innerHTML = body.sandwich; |
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 random | |
| def lambda_handler(event, context): | |
| """ Build a random cold-cut sandwich """ | |
| meats = [ | |
| 'ham', 'salami', 'turkey', 'chicken', 'meatball', 'tempeh' | |
| ] | |
| cheeses = [ |
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
| body { | |
| text-align: justify; | |
| } | |
| code, pre { | |
| font-family: "DejaVuSansMono", monospace; | |
| } | |
| h1, h2, h3, h4, h5, h6 { | |
| text-align: left; |
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
| <label for="strQuery">Enter a string:</label> | |
| <input type="text" id="strQuery"> | |
| <button type="submit" id="submit">Submit</button> | |
| <p id="result"></p> |
NewerOlder