feat(cli): add http.apps field for mounting multiple HTTP apps at path prefixes

Add support for the http.apps config field in langgraph.json that lets
users mount multiple HTTP apps at different path prefixes alongside the
built-in LangGraph API.

Config format:
  {
    "http": {
      "app": "./custom_routes.py:app",
      "apps": {
        "/dashboard": "./dashboard.py:app",
        "/ext": "./extension.js:app",
        "/conduit": "some-npm-package:app"
      }
    }
  }

Changes:
- Add apps: dict[str, str] | None to HttpConfig TypedDict in schemas.py
- Add validation for http.apps entries (prefix must start with /, values
  must be module:attribute format)
- Add _update_http_apps_paths() for Docker container path rewriting
- Add _is_js_http_app() and _has_js_http_apps() helpers for JS detection
- Ensure Node.js is installed in Docker images when JS HTTP apps present
- Regenerate JSON schema files

Co-authored-by: Christian Bromann <christian-bromann@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-03-23 06:09:31 +00:00
co-authored by Christian Bromann
parent 65572a0e6d
commit 468c7546c8
4 changed files with 158 additions and 3 deletions
+19
View File
@@ -446,6 +446,25 @@ class HttpConfig(TypedDict, total=False):
Format: "path/to/module.py:app_var"
If provided, it can override or extend the default routes.
"""
apps: dict[str, str] | None
"""Optional. Record mapping path prefix to app module path.
Each key is a URL path prefix (e.g., "/dashboard"), and each value is an
import path in "file:export" format (e.g., "./dashboard.py:app").
Python apps (.py) are mounted in-process as FastAPI/Starlette sub-applications.
JS apps (.js, .ts, .mts, .mjs) are spawned as Node.js subprocess servers
with a reverse proxy forwarding requests from the main server.
npm package references (paths not starting with . or /) are resolved as
npm imports in the JS subprocess.
Example:
{
"/dashboard": "./dashboard.py:app",
"/ext": "./extension.js:app",
"/conduit": "some-npm-package:app"
}
"""
disable_assistants: bool
"""Optional. If `True`, /assistants routes are removed from the server.