Skip to content

Add configurable HTTP server adapter#1512

Merged
ricardo-devis-agullo merged 3 commits into
masterfrom
refactor/http-server-adapter-phase-5
Jul 7, 2026
Merged

Add configurable HTTP server adapter#1512
ricardo-devis-agullo merged 3 commits into
masterfrom
refactor/http-server-adapter-phase-5

Conversation

@ricardo-devis-agullo

Copy link
Copy Markdown
Collaborator

Summary

  • add server.adapter/server.options config with Express defaulting
  • route registry adapter creation through a server adapter normaliser
  • add unit coverage and update HTTP server adapter status for phase 5

Verification

  • npm run build
  • npm run test -w oc

@ricardo-devis-agullo

Copy link
Copy Markdown
Collaborator Author

@copilot review

Copilot AI commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@copilot review

Here's a summary of the review findings:

Fixed (7c77241 → follow-up commit):

  • options-sanitiser.ts: the two follow-up if (options.server && ...) guards were redundant — options.server is always truthy after the first block sets it. Removed the redundant options.server && conditions.

Observations (no change needed):

  • server-adapter.ts: isHttpServerAdapter only checks native, listen, and httpServer out of the ~15 interface methods. This is intentionally minimal (mirrors duck-typing patterns), but an incomplete adapter would fail later with less clear errors. Could tighten the check in a future pass if desired.
  • express-adapter.ts: the options?: unknown parameter + runtime narrowing handles backward compat (legacy number/string port vs new { port } object) correctly.
  • types.ts: server.options?: unknown loses generic type info compared to the storage adapter's T-based approach, but is acceptable since server adapters are more varied and the type is captured at the factory level.
  • http-server-adapter-status.md at the repo root: if this is intended as a public migration guide, it belongs; if it's a private dev note, it can be removed.

No other issues found. Tests and build verified prior to submission (937 passing).

@ricardo-devis-agullo ricardo-devis-agullo merged commit 5e30e84 into master Jul 7, 2026
3 checks passed
@ricardo-devis-agullo ricardo-devis-agullo deleted the refactor/http-server-adapter-phase-5 branch July 7, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants