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: Next.js
nextjsnamingconventionapi-routes
Name a route handler function `handler` per framework convention
Follow the framework's convention (Next.js API/route handlers are named handler) instead of a custom name.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | const handleUpload = async (req, res) => { /* ... */ }; |
| 2 | export default handleUpload; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | const handler = async (req, res) => { /* ... */ }; |
| 2 | export default handler; |
Explanation (EN)
Objašnjenje (HR)