mirror of
https://github.com/nlepage/go-wasm-http-server.git
synced 2025-03-11 09:39:10 +00:00
⚗️
This commit is contained in:
parent
75a141520e
commit
d9b34161e6
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
> WebAssembly Go HTTP Server embedded in a ServiceWorker
|
> WebAssembly Go HTTP Server embedded in a ServiceWorker
|
||||||
|
|
||||||
### ✨ [Demo](https://nlepage.github.io/go-wasm-http-server/demo)
|
### ✨ [Demo](https://nlepage.github.io/go-wasm-http-server/)
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
|
10
docs/sw.js
10
docs/sw.js
@ -3,10 +3,7 @@ importScripts(
|
|||||||
'https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@96677e251874f074906c61ccebd283c63cdec54d/index.js',
|
'https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@96677e251874f074906c61ccebd283c63cdec54d/index.js',
|
||||||
)
|
)
|
||||||
|
|
||||||
console.log('scope', registration.scope)
|
addEventListener('install', () => {
|
||||||
|
|
||||||
addEventListener('install', event => {
|
|
||||||
console.log('install!')
|
|
||||||
wasmhttp.serve({
|
wasmhttp.serve({
|
||||||
wasm: 'api.wasm',
|
wasm: 'api.wasm',
|
||||||
base: '/api',
|
base: '/api',
|
||||||
@ -14,7 +11,4 @@ addEventListener('install', event => {
|
|||||||
skipWaiting()
|
skipWaiting()
|
||||||
})
|
})
|
||||||
|
|
||||||
addEventListener('activate', event => {
|
addEventListener('activate', event => event.waitUntil(clients.claim()))
|
||||||
console.log('activate!')
|
|
||||||
event.waitUntil(clients.claim())
|
|
||||||
})
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user