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).
backend ruleP2project specificStack: Express / Node.js
routingapi-designconventions
Place routes in the namespace that matches their purpose
Use action/api namespaces for interactions and read namespaces for simple static reads; putting a read under an action path (or vice versa) misleads.
PR: hegnar-ws · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | app.get('/json/purge-cache', purgeHandler); // an action under a read namespace |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | app.get('/api/purge-cache', purgeHandler); // interactions live under /api |
Explanation (EN)
Objašnjenje (HR)