diff --git a/docs/sw.js b/docs/sw.js new file mode 100644 index 0000000..eef3c08 --- /dev/null +++ b/docs/sw.js @@ -0,0 +1 @@ +importScripts('https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@b4be701615d284296a4a1aaa852db02f139969ee/index.js') diff --git a/index.js b/index.js index b8ba0f5..c2464fa 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,5 @@ -const swUrl = 'https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@b4be701615d284296a4a1aaa852db02f139969ee/index.js' - window.wasmhttp = { - register: async (wasm, { scope, base = '' } = {}) => { + register: async (wasm, { scope, base = '', swUrl = 'sw.js' } = {}) => { const options = {} if (scope) options.scope = scope //FIXME register once