serve

    Minimal static HTTP file server for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.1.4
    License
    Apache-2.0
    Last updated
    8 hours ago
    Downloads
    60

    #serve

    Serve a local directory over HTTP through MoonX.

    #Usage

    moonx cli/serve public moonx cli/serve --host 127.0.0.1 --port 8080 public

    Default to the current directory on 127.0.0.1:8000. Serve regular files with GET/HEAD and directory index.html files; print the bound address to stderr.

    #Common options

    OptionDescription
    -h, --helpShow help.
    -V, --versionShow the version.
    --host VALUENumeric IPv4 or IPv6 listen address. Default: 127.0.0.1.
    -p VALUE, --port VALUEListen port. Use 0 to choose an available port. Default: 8000.

    #Notes

    • Every readable file under the selected root, including hidden files, can be served. Use a trusted, stable directory; path checks do not guarantee confinement against concurrent filesystem replacement.
    • There is no directory listing, SPA fallback, upload, range, compression or TLS support. Paths and symlink targets must stay under the selected root.
    • Use numeric IP addresses; port 0 selects an available port. Launcher policy must allow reading the directory and binding the address.

    See the compatibility guide for the supported profile.

    Source Files