Skip to content

Proposal for variable routes #67

@anddave

Description

@anddave

Proposal for variable routes

  • As of RestPS 7.0.44 from PSGallery, only hardcoded routes are supported, which is to say that Invoke-RequestRouter selects routes where {$_.RequestURL -eq $RequestURL}.
  • Consequently endpoints like "api/periodictable/{element}" are marginally feasible in small scale only and not feasible in large scale.
  • Proposal: we could add a regex match to Invoke-RequestRouter which would enable variable routes.
  • For the sake of simplicity, I propose that:
    • Map file should only be changed to support regex matching
    • as opposed to adding any more notational load to the map file, let the endpoint scripts do all the interpreting of variable routes beyond matching the regex.
  • Some defensive code and unit testing may need to be added for mitigating the risk of accidental route doubling if a route is both an exact match and a regex match.
  • Branch and PR forthcoming soon
    Thanks @jpsider great module

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions