mzoon
is a MoonZoon CLI tool.
_
You'll be able to install mzoon
with Cargo:
cargo install --locked mzoon
and faster installation methods with pre-compiled binaries will follow.
- Example:
mzoon new my_project
- Creates a new directory with a new MoonZoon project.
- Optional parameters:
--here
/-h
- Example:
mzoon new my_project --here
- Creates the project in the current directory.
- Example:
- Question: Do you think a code tour would be useful for you?
- Note: Not implemented yet, use MoonZoon/demo as a starting project.
- Example:
mzoon start
- Compiles the app in the debug mode and then starts the Moon's server.
- Both Moon and Zoon apps are automatically recompiled on a file change.
- The Moon app auto-reloads the Zoon app on a change.
- Optional parameters:
--release
/-r
- Example:
mzoon start --release
- Compiles in the release mode and compresses frontend files.
- Example:
--open
/-o
- Example:
mzoon start --open
- Opens the Zoon's URL in a new browser tab (e.g.
localhost:8080
)
- Example:
- Example:
mzoon build
- Compiles the app in the debug mode.
- Optional parameters:
--release
/-r
- Example:
mzoon build --release
- Compiles in the release mode and compresses frontend files.
- Example:
- The configuration file located in the app root directory.
port = 8080
# port = 8443
https = false
cache_busting = true # add UUID to file names - e.g. `frontend_bg_[uuid].wasm`
backend_log_level = "warn" # "error" / "warn" / "info" / "debug" / "trace"
[redirect] # useful for HTTP -> HTTPS redirect
port = 8081
enabled = false
[watch]
frontend = [
"frontend/Cargo.toml",
"frontend/src",
]
backend = [
"backend/Cargo.toml",
"backend/src",
]
-
"What about other commands like
deploy
andtest
?"- Other commands will be added later.
- You can use standard
cargo test
for testing the backend side. mzoon build
automatically installswasm-pack
in thefrontend
directory. So you can usewasm-pack
directly for testing.
-
"How can I change the port number or enable HTTPS?"
-
For development: Update settings in
MoonZoon.toml
(seeMoonZoon.toml
above or/examples/counter/MoonZoon.toml
) -
For production: Set environment variables (see
/crates/moon/src/config.rs
)
-
-
"Some commands or parameters mentioned above don't work!"
- They are probably not implemented yet.
-
"What is a new project file structure?"
- See the content of MoonZoon/demo to have an idea.