Skip to content

andyzal/icstatica

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Static HTML Website on the IC.

Install the Canister SDK

You can check if dfx is already installed with dfx --version. You can find more info here.

To download the DFINITY Canister SDK, run the following command in your terminal:

sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"

Step 1: Configuration File

The file dfx.json is the configuration file which contains configurable options for your project.

{
    "canisters": {
        "web": {
            "type": "assets",
            "source": [
                "www",
                "www/css"
            ]
        }
    }
}

The example above creates an assets canister named web. In source all the asset directories are specified which will get uploaded to the canister.

Step 2: Basic HTML and CSS

In the previous step we specified that the assets will be contained in www and www/css, which contain index.html and style.css respectively.

Step 3: Deploy to IC

If you need help deploying the project, then you can find more information here.

dfx start
# Deploy locally (e.g. localhost:8000)
dfx deploy
# or on the IC itself
dfx deploy --network=ic

Depending where you deployed the canister, you can find it on:

  • http://localhost:8000/?canisterId=<canister id>
  • <canister id>.ic0.app

Updates: More readings on deployment process: https://sdk.dfinity.org/docs/quickstart/network-quickstart.html Note: There is not necessary to use npm install or having node package installed as this is assumed that to www folder we copy a coplete content of dist/spa folder build up in other place. Consider dfx deploy --network=ic --no-wallet instead of dfx deploy --network=ic To provide smooth usage on mobile browsers rather use https://gsueu-yaaaa-aaaae-aaagq-cai.raw.ic0.app where name of the canister is replaced by your name of the asset container.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Generated from allusion-be/ic-static