Revert "⚗️ Try w/o using jsdelivr"

This reverts commit 2a84a402ce54760604057daa53ca991d43fda347.
This commit is contained in:
Nicolas Lepage 2021-01-21 22:00:21 +01:00
parent a6785f45f9
commit a9981520e5
No known key found for this signature in database
GPG Key ID: B0879E35E66D8F6F
2 changed files with 5 additions and 6 deletions

View File

@ -2,16 +2,15 @@
<html> <html>
<head> <head>
<title>go-wasm-http-server demo</title> <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> <script>
async function hello() { async function hello() {
const name = document.querySelector("#name").value res = await fetch('api/hello', {
const res = await fetch('api/hello', {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}, },
body: JSON.stringify({ name }) body: JSON.stringify({ name: document.querySelector("#name").value })
}) })
const { message } = await res.json() const { message } = await res.json()
alert(message) alert(message)
@ -19,7 +18,7 @@
</script> </script>
</head> </head>
<body> <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> <button onclick="hello()">Hello</button>
<script> <script>
wasmhttp.register('api.wasm', { base: 'api' }) wasmhttp.register('api.wasm', { base: 'api' })

View File

@ -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')