package.json embed
Node projects can keep routeup config in package.json under a top-level
routeup key. Routing fields are shared with
routeup.json, but runner configuration is
source-specific: a package.json embed selects a package script with script,
while standalone routeup.json uses command.
Example
Section titled “Example”{ "name": "example-app-web", "scripts": { "dev": "routeup", "dev:app": "vite" }, "routeup": { "name": "example-app", "script": "dev:app" }}Here npm run dev launches routeup, which runs your real dev server
(dev:app) behind https://example-app.localhost and injects PORT, HOST,
ROUTEUP_LOCAL_URL, and ROUTEUP_URL. In local-only runs, ROUTEUP_URL is the local URL; when public exposure is enabled, it becomes the public URL. See the bare
routeup command for the script-runner flow.
The routeup block
Section titled “The routeup block”name optional default route name (separate from the package's own name)port local port to proxy toscript package script to run in script-runner modeport_env_var additional environment variable that receives the assigned porttargets optional list of path-routed targets for one-origin frontend + API setupsexpose optional public exposure settings, including pathscapture optional request/response capture settings for routeup inspectcommand is not valid inside the package.json routeup block. Define the
command in scripts and reference that script by name with routeup.script.
When set, port_env_var receives the same value as PORT; it cannot name
Routeup-managed variables, HOST, PATH, or NODE_EXTRA_CA_CERTS.
The routeup.name is independent of the package’s name field, the package can
be example-app-web while the route is example-app. If routeup.name is
omitted, bare runner mode uses ROUTEUP_NAME and then the working-directory
basename.
Precedence
Section titled “Precedence”If a directory has both a routeup.json and a package.json routeup block,
routeup.json wins. Config is discovered in the current working directory only.
Why embed
Section titled “Why embed”For a JS project you already have a package.json. Adding a routeup block (and
pointing a dev script at routeup) is the lowest-friction way to give the
project a stable route that travels with the repo.