mirror of
https://github.com/nlepage/go-wasm-http-server.git
synced 2025-03-10 17:29:10 +00:00
⏪ Revert "⚗️ Try w/o using jsdelivr"
This reverts commit 2a84a402ce54760604057daa53ca991d43fda347.
This commit is contained in:
parent
a6785f45f9
commit
a9981520e5
@ -2,16 +2,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>go-wasm-http-server demo</title>
|
||||
<script src="https://raw.githubusercontent.com/nlepage/go-wasm-http-server/master/index.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@254bd5e2ea5b84b4ed2918f8edc7981fb24b06ad/index.js"></script>
|
||||
<script>
|
||||
async function hello() {
|
||||
const name = document.querySelector("#name").value
|
||||
const res = await fetch('api/hello', {
|
||||
res = await fetch('api/hello', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ name })
|
||||
body: JSON.stringify({ name: document.querySelector("#name").value })
|
||||
})
|
||||
const { message } = await res.json()
|
||||
alert(message)
|
||||
@ -19,7 +18,7 @@
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<label for="name">Name: </label><input id="name" value="World">
|
||||
<label for="name">Name : </label><input id="name" value="World">
|
||||
<button onclick="hello()">Hello</button>
|
||||
<script>
|
||||
wasmhttp.register('api.wasm', { base: 'api' })
|
||||
|
@ -1 +1 @@
|
||||
importScripts('https://raw.githubusercontent.com/nlepage/go-wasm-http-server/master/sw.js')
|
||||
importScripts('https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@254bd5e2ea5b84b4ed2918f8edc7981fb24b06ad/sw.js')
|
||||
|
Loading…
x
Reference in New Issue
Block a user