Menu

Unmounted Routers and Unreachable Routes
📰

Unmounted Routers and Unreachable Routes

DEV Community: api·Jeff·11 days ago
#tC7M0ztV
#devtoapi#devto#dev#router#routes
Reading 0:00
15s threshold

Quick answer: An unmounted router is a router object that exists in the code but is never attached to the running app, so the routes it defines are unreachable. The scan reports routes and routers that are never mounted rather than treating every defined path as a live endpoint, keeping dead code out of the adopted contract. A resolved route definition and a reachable route are two different things.

Why defined routes can still be dead

It is easy to assume that a path with a handler is callable, but the handler only matters if a router is mounted on the app. A router left over from a refactor, behind a feature flag, or constructed but never wired in keeps all its routes unreachable even though the code looks complete.

That creates a gap between the code that exists and the surface that actually runs.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.