-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add info to website #3403
Add info to website #3403
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 <subcommand>` | ||||||
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 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
WAN is incorrect. 0.0.0.0 makes the port exposed on the local network. It has to be exposed. Also, it not recommended to use trunk for anything else other development so I would like to not recommend this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hamza1311 "0.0.0.0 for WAN" is for remote development (ssh client). I agree that is not recommended! But any alternative for this cases? |
||||||
# The port to serve on. | ||||||
port = 8000 | ||||||
``` | ||||||
|
||||||
If you are curious, you can run `trunk help` and `trunk help <subcommand>` for more details on what is happening. | ||||||
|
||||||
### Congratulations | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hamza1311 suggested changes implemented in PR #3406. |
||||||
|
||||||
```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 | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hamza1311 suggested changes implemented in PR #3406.