Last active
June 11, 2020 15:49
-
-
Save bacongravy/41dc1e1c9a7e038c637691fd165530fb 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
<html> | |
<head> | |
<title> | |
Hello API Example | |
</title> | |
<script lang="javascript"> | |
fetch("/api/hello") | |
.then((res) => res.text()) | |
.then((text) => { | |
document.getElementById("api-response").innerHTML = text; | |
}); | |
</script> | |
</head> | |
<body> | |
<p>Response from /api/hello: <span id="api-response"></span></p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment