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.

Syntax

Usage: curiosity-cli serve --server <url> [--path <dir>] [--name <name>] [--port <port>] [options]

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

Option Description
--server Workspace URL to proxy API calls to. Strongly recommended to set explicitly. Alias -s. Default: guessed from the bundle.
--path Local path to the compiled h5/ folder. Alias -p. Default pwd.
--name App name shown in the dev UI's nav bar. Default Mosaik.
--ignore-certificate-errors Disable TLS validation against the proxied workspace. Dev only. Default false.
--port Local TCP port to bind. Default 5000.
--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 Bind to 0.0.0.0 instead of localhost. Useful for testing from another device on the same network. Default false.
--enable-cors Enable CORS on the local server. Default false.
--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

Remarks

  • Use serve to iterate on a custom front-end locally while talking to a remote workspace, instead of re-uploading after each change.
  • The target folder must be a compiled Mosaik.FrontEnd bundle (it must contain a mosaik.app marker), and the remote workspace must allow CORS from the dev server's origin.
  • Pass --server explicitly; the URL-guessing fallback is for convenience only and shouldn't be relied on. --ignore-certificate-errors is for local development only.

See also

© 2026 Curiosity. All rights reserved.