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 ruleP2universalStack: Node / nginx
infrastructureredirectsseparation-of-concernsproxy
Let the proxy/infra layer own concerns like trailing-slash redirects
Don't hand-roll per-route redirect logic in app code for things the reverse proxy (nginx) should handle globally; otherwise you must repeat it for every future route.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejs
| 1 | if (req.path === '/home/') res.redirect('/home'); // per-route, must repeat |
Explanation (EN)
Objašnjenje (HR)
Good example
New codenginx
| 1 | // handle trailing-slash normalization once at the nginx/proxy layer |
Explanation (EN)
Objašnjenje (HR)