Skip to content

Instantly share code, notes, and snippets.

@nidhi-canopas
Last active February 23, 2023 20:13
Show Gist options
  • Save nidhi-canopas/2e2b1f18bed5f93ecb2ddcd6977d1ebf to your computer and use it in GitHub Desktop.
Save nidhi-canopas/2e2b1f18bed5f93ecb2ddcd6977d1ebf to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Demo</title>
</head>
<body>
<p>Welcome to CORS demo</p>
<script type="text/javascript">
async function invokeAPI() {
var result = await fetch('http://localhost:3000/ping')
.then(response => response.json());
console.log(result)
}
window.onload = invokeAPI();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment