Skip to main content

resolve_route_path

Function resolve_route_path 

Source
pub fn resolve_route_path(path: &str, route_base: &str) -> String
Expand description

Resolve a route path against a base path.

  • Relative paths (topics/:id or ./topics/:id) are prepended with the base.
  • Absolute paths (/topics/:id) are returned unchanged.

"topics/:id" + "/sections/1" → "/sections/1/topics/:id" "./topics/:id" + "/sections/1" → "/sections/1/topics/:id" "/topics/:id" + "/sections/1" → "/topics/:id"