diff --git a/website/docs/tutorial/index.mdx b/website/docs/tutorial/index.mdx index 9bf1c2c34bd..9f1b4759c97 100644 --- a/website/docs/tutorial/index.mdx +++ b/website/docs/tutorial/index.mdx @@ -117,12 +117,24 @@ Now, let's create an `index.html` at the root of the project. Run the following command to build and serve the application locally. ```bash -trunk serve --open +trunk serve --open // remove option '--open' to not open your default browser ``` Trunk will open your application in your default browser, watch the project directory and helpfully rebuild your -application if you modify any source files. If you are curious, you can run `trunk help` and `trunk help ` -for more details on what is happening. +application if you modify any source files. +This will fail if the socket is being used by another application. +By default server will listening at address '127.0.0.1' and port '8080' [localhost:8080](http://127.0.0.1:8080). +To change it, create the following file and edit as needed: + +```toml title="Trunk.toml" +[serve] +# The address to serve on. +address = "127.0.0.1" // "0.0.0.0" for WAN +# The port to serve on. +port = 8000 +``` + +If you are curious, you can run `trunk help` and `trunk help ` for more details on what is happening. ### Congratulations diff --git a/website/versioned_docs/version-0.20/getting-started/build-a-sample-app.mdx b/website/versioned_docs/version-0.20/getting-started/build-a-sample-app.mdx index 996bd3f4a92..7db716c4a94 100644 --- a/website/versioned_docs/version-0.20/getting-started/build-a-sample-app.mdx +++ b/website/versioned_docs/version-0.20/getting-started/build-a-sample-app.mdx @@ -46,7 +46,7 @@ To convert this simple command line application to a basic Yew web application, #### Update Cargo.toml -Add `yew` to the list of dependencies. +Add `yew` to the list of dependencies editing file: ```toml title=Cargo.toml [package] @@ -58,6 +58,8 @@ edition = "2021" yew = { version = "0.20.0", features = ["csr"] } ``` +or using `cargo add yew -F csr`. + :::info You only need feature `csr` if you are building an application. @@ -128,10 +130,21 @@ Finally, add an `index.html` file in the root directory of your app. Run the following command to build and serve the application locally. ```bash -trunk serve +trunk serve // add option '--open' to open your default browser ``` Trunk will rebuild your application if you modify any of its source code files. +This will fail if the socket is being used by another application. +By default server will listening at address '127.0.0.1' and port '8080' [localhost:8080](http://127.0.0.1:8080). +To change it, create the following file and edit as needed: + +```toml title="Trunk.toml" +[serve] +# The address to serve on. +address = "127.0.0.1" // "0.0.0.0" for WAN +# The port to serve on. +port = 8000 +``` ## Congratulations diff --git a/website/versioned_docs/version-0.20/tutorial/index.mdx b/website/versioned_docs/version-0.20/tutorial/index.mdx index 83e70685449..da593f33c69 100644 --- a/website/versioned_docs/version-0.20/tutorial/index.mdx +++ b/website/versioned_docs/version-0.20/tutorial/index.mdx @@ -117,12 +117,24 @@ Now, let's create an `index.html` at the root of the project. Run the following command to build and serve the application locally. ```bash -trunk serve --open +trunk serve --open // remove option '--open' to not open your default browser ``` Trunk will open your application in your default browser, watch the project directory and helpfully rebuild your -application if you modify any source files. If you are curious, you can run `trunk help` and `trunk help ` -for more details on what's happening. +application if you modify any source files. +This will fail if the socket is being used by another application. +By default server will listening at address '127.0.0.1' and port '8080' [localhost:8080](http://127.0.0.1:8080). +To change it, create the following file and edit as needed: + +```toml title="Trunk.toml" +[serve] +# The address to serve on. +address = "127.0.0.1" // "0.0.0.0" for WAN +# The port to serve on. +port = 8000 +``` + +If you are curious, you can run `trunk help` and `trunk help ` for more details on what's happening. ### Congratulations