Curiosity CLI

serve

Serves a locally built custom front-end over HTTP while proxying API calls to a remote workspace. The fastest way to iterate on a custom UI without re-uploading after every change.

The folder you point at must look like a compiled Mosaik.FrontEnd bundle — the CLI checks for a mosaik.app marker file in the root.

Usage

curiosity-cli serve \
  --server https://my-workspace.example.com/ \
  --path   ./MyApp/bin/Debug/netstandard2.0/h5/

If --path is omitted, the current working directory is used. If --server is omitted, the CLI tries to guess the workspace URL by scanning the *.js files in the bundle for a serverURL / apiURL variable — don't rely on this in real workflows, pass --server explicitly.

Options

Flag Alias Default Description
--server -s (guessed) Workspace URL to proxy API calls to. Strongly recommended to set explicitly.
--path -p pwd Local path to the compiled h5/ folder.
--name --name Mosaik App name shown in the dev UI's nav bar.
--ignore-certificate-errors false Disable TLS validation against the proxied workspace. Dev only.
--port 5000 Local TCP port to bind.
--cert-file - Path to a certificate to enable HTTPS on the local listener.
--cert-password - Password for the cert file, if encrypted.
--listen-to-any false Bind to 0.0.0.0 instead of localhost. Useful for testing from another device on the same network.
--enable-cors false Enable CORS on the local server.
--path-base - Mount the dev server under a base path (e.g. /myapp).

How it works

Under the hood, serve:

  1. Starts a local Kestrel server pointing at your h5/ folder.
  2. Patches the workspace's served HTML so the browser loads your JS bundle.
  3. Proxies all /api/... calls to the configured --server.
  4. Watches the h5/ folder and reloads when the bundle changes.

For this to work, the remote workspace must allow CORS from the dev server's origin. Add http://localhost:5000 (or whatever port you used) to the MSK_CORS environment variable and restart the workspace process.

Typical workflow

See Custom Front-End development workflow for the full loop. The short version:

dotnet build
curiosity-cli serve -s http://localhost:8080 -p bin/Debug/netstandard2.0/h5
# Iterate, then when ready:
curiosity-cli upload-front-end -s http://localhost:8080 -t $CURIOSITY_TOKEN -p bin/Debug/netstandard2.0/h5

See also

Referenced by

© 2026 Curiosity CLI. All rights reserved.