Skip to content

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.

{
"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.

name route / project name (separate from the package's own name)
port local port to proxy to
script package script to run in script-runner mode
targets optional list of path-routed targets for one-origin frontend + API setups
expose optional public exposure settings, including paths
capture optional request/response capture settings for routeup inspect

command is not valid inside the package.json routeup block. Define the command in scripts and reference that script by name with routeup.script.

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 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.

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.