peterpeterparker / icwebworker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Poll canister on the IC with web workers

Sample repo for upcoming blog post.

How to

git clone https://github.com/peterpeterparker/icwebworker
cd icwebworker
npm ci
dfx start --background
dfx deploy

Once deployed, access your canister locally with http://<canister-id>.localhost:8000/.

Note

Do not access this canister locally with query param http://127.0.0.1:8000/?canisterId=<canister-id>.

Using a param would lead to following issue in the browser:

Uncaught NetworkError: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://127.0.0.1:8000/vendors-node_modules_dfinity_auth-client_lib_esm_index_js.index.js' failed to load.

About


Languages

Language:JavaScript 84.4%Language:CSS 6.8%Language:HTML 5.4%Language:Motoko 3.4%