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:
- Starts a local Kestrel server pointing at your
h5/folder. - Patches the workspace's served HTML so the browser loads your JS bundle.
- Proxies all
/api/...calls to the configured--server. - 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
upload-front-end— push the bundle to the workspace when iteration is done.- H5 Getting Started — the compiler that produces the
h5/folder. - Tesserae UI — the component library most custom front-ends are built on.
- Custom Front-End development workflow.