Skip to content

Latest commit

 

History

History
93 lines (65 loc) · 2.15 KB

cli.md

File metadata and controls

93 lines (65 loc) · 2.15 KB

CLI - mzoon


mzoon is a MoonZoon CLI tool.

_

You'll be able to install or update it with Cargo:

cargo install --locked mzoon

(why --locked?)

Note: Faster installation options will be added later.


Commands

1. new

  • Example: mzoon new my_project
  • Creates a new directory with a MoonZoon project.

2. start

  • 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:
    1. --release / -r
      • Example: mzoon start --release
      • Compiles in the release mode; Zoon auto-reload is disabled.
    2. --open / -o
      • Example: mzoon start --open
      • Opens the Zoon's URL in a new browser tab (e.g. localhost:8080)

3. build

  • Example: mzoon build
  • Compiles the app in the debug mode.
  • Optional parameters:
    1. --release / -r
      • Example: mzoon build --release
      • Compiles in the release mode.

MoonZoon.toml

  • The configuration file located in the app root directory.
port = 8080
# port = 8443
https = false

[redirect_server] # useful for HTTP -> HTTPS redirect
port = 8081
enabled = false

[watch]
frontend = [
    "frontend/Cargo.toml",
    "frontend/src",
]
backend = [
    "backend/Cargo.toml",
    "backend/src",
]

FAQ

  1. "What about other commands like deploy, test, generate, etc.?"

    • Other commands will be added later.
  2. "How can I change the port number or enable HTTPS?"

    • For development: Update settings in MoonZoon.toml (see MoonZoon.toml above or /examples/counters/MoonZoon.toml)

    • For production: Set environment variables (see the function load_config in /crates/moon/src/lib.rs)

  3. "Some commands or parameters mentioned above don't work!"

    • They are probably not implemented yet.
  4. "What is a new project file structure?"

    • See the content of /examples/time_tracker or MoonZoon/demo to have an idea.