Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
fullstack ruleP2stack specificStack: node
architectureapiperformancenetwork
Call the backend that owns the data directly instead of proxying through extra hops
Avoid routing a request web -> ws -> backend when the client can call the owning service directly, or fold extra data into an existing response.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | const news = await fetch('/api/news'); |
| 2 | const logo = await fetch('/api/news-logo'); // second hop for data the first call could include |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | const news = await fetch('/api/news'); // logoUrl included in the same response |
| 2 | // use news.logoUrl directly |
Explanation (EN)
Objašnjenje (HR)