Dynamic /defaultConnection route handler
- Dominant language
- TypeScript
- Stars
- 481
- Forks
- 108
- Avg merge
- 8d 9h
- Merged PRs (30d)
- 7
Description
## Parent PRD
#1670
## What to build
Replace the `express.static("/defaultConnection", ...)` mount with a `GET /defaultConnection` route handler that returns in-memory computed default connection data as JSON. This eliminates the need for `process-environment.sh` to write `defaultConnection.json` to disk.
The route handler:
- Computes the default connection data from the resolved configuration pipeline (#1673)
- Returns the same JSON shape and field names as today (`GRAPH_EXP_PUBLIC_OR_PROXY_ENDPOINT`, `GRAPH_EXP_SERVICE_TYPE`, `GRAPH_EXP_GRAPH_TYPE`, `GRAPH_EXP_USING_PROXY_SERVER`, `GRAPH_EXP_IAM`, `GRAPH_EXP_CONNECTION_URL`, `GRAPH_EXP_AWS_REGION`, `GRAPH_EXP_FETCH_REQUEST_TIMEOUT`, `GRAPH_EXP_NODE_EXPANSION_LIMIT`)
- Returns 404 if no default connection is configured (no `PUBLIC_OR_PROXY_ENDPOINT`)
- Conditionally includes `GRAPH_EXP_GRAPH_TYPE` only when explicitly provided or auto-detected for `neptune-graph` (preserving current behavior where omission causes the client to create one connection per query engine)
Refer to the "Default Connection Endpoint" section of #1670 for details.
## Acceptance criteria
- [ ] `GET /defaultConnection` returns JSON with the same shape as the current `defaultConnection.json`
- [ ] All documented fields are included (including `GRAPH_EXP_FETCH_REQUEST_TIMEOUT` and `GRAPH_EXP_NODE_EXPANSION_LIMIT`)
- [ ] `GRAPH_EXP_GRAPH_TYPE` is conditionally included (omitted when not set, auto-detected for `neptune-graph`)
- [ ] Returns 404 when no default connection is configured
- [ ] No file is written to disk
- [ ] Existing client-side `defaultConnection.ts` fetching works without changes
- [ ] Unit tests cover: all fields present, conditional GRAPH_TYPE, neptune-graph auto-detection, 404 case
## Blocked by
- Blocked by #1673
## User stories addressed
- User story 1
- User story 2
- User story 3
- User story 10
Contributor guide
Research direction
Start with blocked issue #1673 and the Default Connection Endpoint section of #1670 to understand the resolved configuration pipeline. Compare the current process-environment.sh output with client-side defaultConnection.ts and identify the existing server route or static mount. Done means GET /defaultConnection returns the documented JSON, handles conditional GRAPH_TYPE and the 404 case, writes no file, and has unit tests for the listed scenarios.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell, typescript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100