Skip to content

Make server port configurable #23

Description

@StatPan

Goal

Honor PORT for the Hono server without breaking Vite proxy, Docker, or CLI expectations.

Derived from #14 Phase 6 dirty branch handoff.

Scope

  • Keep the runtime change focused on src/server/index.ts.
  • Update docs/config references if they assume a hardcoded port.
  • Confirm compose/dev defaults remain 3001.

Out of Scope

  • Do not change OpenCode approval/question behavior.
  • Do not change deployment topology or auth behavior.

Acceptance Criteria

Functional:

  • Server uses PORT when set.
  • Server defaults to 3001 when PORT is unset.
  • README/compose/dev guidance remains accurate.

Code/product quality:

  • Port parsing is explicit and handles invalid values predictably.
  • The change is covered by a smoke test or focused config/unit test.

Verification

  • PORT=3002 ./node_modules/.bin/tsx src/server/index.ts smoke test if OpenCode/env is available, or a focused config/unit test if not.
  • ./node_modules/.bin/tsc -p tsconfig.json --noEmit.
  • git diff --check.

Expected Delivery

  • Delivery mode: small focused PR.
  • Review mode: verify default compatibility and configured-port smoke evidence.
  • Merge mode: safe to merge without owner escalation if tests and docs pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent:workerReady for an implementation worker.area:backendBackend, CLI, and core workflow implementation.priority:p2Medium priority work.status:readyReady to start.type:taskConcrete implementation task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions