Created
February 17, 2021 12:10
-
-
Save bennett39/efa253d1208c38e51741f0ab60b4d451 to your computer and use it in GitHub Desktop.
This file contains 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; | |
} | |
</script> | |
</head> | |
<body> | |
<h1>Sandwich Generator</h1> | |
<p>Click the button, get a sandwich!</p> | |
<input type="button" value="Make a sandwich!" onclick="fetchSandwich()"> | |
<p id="sandwich-result"></p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment