Skip to content

docs(server): Add rules file for server middleware#1457

Merged
matz3 merged 2 commits into
mainfrom
fix/serve-resources-node-api
Jul 17, 2026
Merged

docs(server): Add rules file for server middleware#1457
matz3 merged 2 commits into
mainfrom
fix/serve-resources-node-api

Conversation

@matz3

@matz3 matz3 commented Jul 17, 2026

Copy link
Copy Markdown
Member

No description provided.

@matz3
matz3 requested a review from a team July 17, 2026 11:23
@matz3
matz3 force-pushed the fix/serve-resources-node-api branch from 12d02c1 to 4c7555d Compare July 17, 2026 14:11
@matz3 matz3 changed the title refactor(server): Add rules file for server middleware docs(server): Add rules file for server middleware Jul 17, 2026
matz3 added 2 commits July 17, 2026 16:18
Introduce .claude/rules/server-middleware.md as a home for rules that
apply to every middleware in packages/server/lib/middleware/. The first
rule requires middlewares to use only the built-in Node.js HTTP API so
the underlying HTTP framework (currently Express) can be swapped without
rewriting any middleware. Future middleware rules can be added as
sections in the same file.
…ources

The serveResources middleware relied on Express's res.send, violating the
rule that middlewares must use only the built-in Node.js HTTP API so the
framework can be swapped. Replace both res.send calls with res.end and set
Content-Length explicitly (byte length for the injected HTML string).

Also drop the resolved 'Known debt' entry for serveResources from
.claude/rules/server-middleware.md.
@matz3
matz3 force-pushed the fix/serve-resources-node-api branch from 4c7555d to 206f948 Compare July 17, 2026 14:18
@matz3
matz3 merged commit 7438bc1 into main Jul 17, 2026
60 checks passed
@matz3
matz3 deleted the fix/serve-resources-node-api branch July 17, 2026 14:38
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