Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

Latest commit

 

History

History
96 lines (68 loc) · 2.35 KB

cli.md

File metadata and controls

96 lines (68 loc) · 2.35 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.
  • Question: Do you think a code tour would be useful for you?
  • Note: Not implemented yet, use MoonZoon/demo as a starting 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 and compress frontend files.
    2. --open / -o
      • Example: mzoon start --open
      • Opens the Zoon's URL in a new browser tab (e.g. localhost:8080)
      • Note: Not implemented yet.

3. build

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

MoonZoon.toml

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

[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?"