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 ruleP2stack specificStack: node
restroutingapi-designhttp
Don't repeat the resource or an action verb in a REST route path
Routes in routes/user.js are already under /user, and an /update segment is redundant when the method is PUT/PATCH; let the mount point and HTTP method carry that meaning.
PR: profico-mining-2026-06Created: Jul 26, 2026
Bad example
Old codejavascript
| 1 | // routes/user.js |
| 2 | router.post("/user/update", ...) |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejavascript
| 1 | // routes/user.js (mounted at /user) |
| 2 | router.patch("/:id", ...) |
Explanation (EN)
Objašnjenje (HR)