dfinityinternet-computermotoko

Dfinity Quickstart for internet computer


I've been trying to get the quickstart working, but the various dfx commands doen't seem to generate the necessary html page and css file required for the application. When you deploy the canister locally, and then call it at http://localhost:8000/?canisterId=xxx instead of generating the web page, it just shows javascript messages and dialog boxes.

According to the quickstart, when you run dfx canister install --all, you're supposed to get a log that looks like

 Installing code for canister explore_hello, with canister_id rrkah-fqaaa-aaaaa-aaaaq-cai
Installing code for canister explore_hello_assets, with canister_id ryjl3-tyaaa-aaaaa-aaaba-cai
Authorizing our identity (pubs-id) to the asset canister...
Uploading assets to asset canister...
  /index.html 1/1 (480 bytes)
  /index.js 1/1 (296836 bytes)
  /main.css 1/1 (484 bytes)
  /sample-asset.txt 1/1 (24 bytes)
  /logo.png 1/1 (25397 bytes)
  /index.js.map 1/1 (964679 bytes)
  /index.js.LICENSE.txt 1/1 (499 bytes)
 

What I get is just:

Installing code for canister explore_hello, with canister_id rrkah-fqaaa-aaaaa-aaaaq-cai
Installing code for canister explore_hello_assets, with canister_id ryjl3-tyaaa-aaaaa-aaaba-cai
Authorizing our identity (default) to the asset canister...
Uploading assets to asset canister...

And then it just returns to the terminal prompt, apparently no assets uploaded. Also there is no index.html or 'main.css` file in my hello-assets assets directory. You can load the page at the appropriate url (http:localhost:8000/?canisterId=' but you don't get a page, you just get the javascript prompt


Solution

  • If you just want to launch a static simple website, you can use fleek.co's free service dedicated for hosting website on IC. It helps you create a canister, automate deployment from local repo to Github, and can support a variety of frontend frameworks such as Gatsby. Your site will be deployed on the Internet Computer with https://xxxxx-xxxxx-xxxxx-xxxxx-cai.ic0.app address.

    For example, I just created a one-pager navigation page for DFINITY-related sites Internet Computer Big Bang! with this method. Once the index.html page was ready, it took literally a few minutes to launch the site on IC. I found it much easier to deploy this way with fleek.co than following the official tutorial from DFINITY.