|
1 | | ---- |
2 | | -keywords: [html5, html, godot, hosting, host a website, beginner] |
3 | | ---- |
4 | | - |
5 | 1 | # Godot HTML5 sample |
6 | 2 |
|
7 | 3 | [View this sample's code on GitHub](https://github.com/dfinity/examples/tree/master/hosting/godot-html5-template) |
8 | 4 |
|
9 | 5 | ## Overview |
10 | | -The example shows how to deploy a Godot HTML5 build on the IC in an asset canister. The Godot HTML5 build is deployed as frontend, no backend is needed in this sample. |
11 | 6 |
|
12 | | -This example project can be cloned, installed, and deployed locally, for learning and testing purposes. The instructions are based on running the example on either macOS or Linux, but when using WSL2 on Windows, the instructions will be the same. |
| 7 | +The example shows how to deploy a Godot HTML5 build on ICP in an asset canister. The Godot HTML5 build is deployed as frontend, no backend is needed in this sample. |
13 | 8 |
|
14 | | -## Prerequisites |
| 9 | +## Project structure |
15 | 10 |
|
16 | | -This example requires an installation of: |
| 11 | +The `/frontend` folder contains the pre-built Godot HTML5 export. The frontend is deployed as an asset canister. |
17 | 12 |
|
18 | | -- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/setup/install/). |
| 13 | +## Prerequisites |
19 | 14 |
|
20 | | -- [x] Download and install [git](https://git-scm.com/downloads). |
| 15 | +- [x] Install [icp-cli](https://cli.icp.build): `npm install -g @icp-sdk/icp-cli @icp-sdk/ic-wasm` |
21 | 16 |
|
22 | 17 | ## Install |
23 | 18 |
|
24 | | -Clone the example dapp project: |
| 19 | +Clone the example project: |
25 | 20 |
|
26 | 21 | ```bash |
27 | 22 | git clone https://github.com/dfinity/examples |
28 | 23 | cd examples/hosting/godot-html5-template |
29 | 24 | ``` |
30 | 25 |
|
31 | 26 | ## Deployment |
32 | | -The local replica is started by running this command: |
| 27 | + |
| 28 | +Start the local network: |
33 | 29 |
|
34 | 30 | ```bash |
35 | | -dfx start --background |
| 31 | +icp network start -d |
36 | 32 | ``` |
37 | 33 |
|
38 | | -When the local replica is up and running, run this command to deploy the canisters: |
| 34 | +Deploy the canisters: |
39 | 35 |
|
40 | 36 | ```bash |
41 | | -dfx deploy |
| 37 | +icp deploy |
| 38 | +``` |
| 39 | + |
| 40 | +The URL for the frontend depends on the canister ID. When deployed, the URL will look like this: |
| 41 | + |
| 42 | +``` |
| 43 | +http://{canister_id}.localhost:8000 |
42 | 44 | ``` |
43 | 45 |
|
44 | | -If you get error code 500 after deploying to the IC mainnet, try to use `raw` keyword in the URL like this: `https://<canister-id>.raw.ic0.app`. |
| 46 | +Stop the local network when done: |
45 | 47 |
|
46 | | -## License |
47 | | -This project is licensed under the Apache 2.0 license, see `LICENSE.md` for details. See `CONTRIBUTE.md` for details about how to contribute to this project. |
| 48 | +```bash |
| 49 | +icp network stop |
| 50 | +``` |
0 commit comments