Insert route with relative positioning Allows inserting routes before/after specific route IDs
Existing routes
Route to insert
Positioning options
New routes array with route inserted
// Insert at beginninginsertRouteRelative(routes, newRoute, { position: "beginning" })// Insert after health checkinsertRouteRelative(routes, newRoute, { afterId: "global-health" })// Insert before catch-allinsertRouteRelative(routes, newRoute, { beforeId: "catch-all" }) Copy
// Insert at beginninginsertRouteRelative(routes, newRoute, { position: "beginning" })// Insert after health checkinsertRouteRelative(routes, newRoute, { afterId: "global-health" })// Insert before catch-allinsertRouteRelative(routes, newRoute, { beforeId: "catch-all" })
Insert route with relative positioning Allows inserting routes before/after specific route IDs