Small Express server for local OpenMCT development: it serves a static OpenMCT build and exposes /proxyUrl so the browser stays same-origin (for example http://127.0.0.1:8080) while your backend (FastMIO, Tomcat, and similar) runs on another port.
- Node.js (with
npm) - A built OpenMCT tree (the directory you set as
STATIC_DIR)
cd dev-proxy
npm installSTATIC_DIR is required and must be the directory containing your static OpenMCT files (including index.html).
STATIC_DIR=/path/to/openmct-build/instances/fastmiotesting npm startExample with a relative path (adjust to your layout):
STATIC_DIR=../../openmct-build/instances/fastmiotesting npm startThen open http://127.0.0.1:8080/ (or the host/port you set with PORT).
| Variable | Description |
|---|---|
PORT |
Listen port (default 8080) |
STATIC_DIR |
Required. Directory of the static OpenMCT build |
PROXY_ALLOW_ANY |
Set to 1 or true to allow proxying to non-localhost targets. Development use only; leave unset to restrict to localhost and *.localhost |
The app forwards requests to the URL in the query string: /proxyUrl?url=<encoded-url>. The HTTP method and body are passed through. Only http: and https: targets are allowed.
By default, the target hostname must be local (localhost, 127.0.0.1, IPv6 loopback, or *.localhost) unless PROXY_ALLOW_ANY is set.
- Name:
openmct-dev-proxy(private; seepackage.json) - Dependencies:
express,http-proxy