This commit is contained in:
Nicolas Lepage 2019-11-27 11:47:20 +01:00
parent e89ed3ec01
commit d4aa7472a6
No known key found for this signature in database
GPG Key ID: B0879E35E66D8F6F

View File

@ -3,7 +3,7 @@
<head>
<title>go-wasm-http-server demo</title>
<script>
function hello() {
async function hello() {
res=await fetch('api/hello', {
method: 'POST',
headers: {
@ -11,6 +11,8 @@
},
body: JSON.stringify({ name: document.querySelector("#name").value })
})
const { message } = await res.json()
alert(message)
}
</script>
</head>