Skip to content

Access string matched against wildcard #96

@untitaker

Description

@untitaker

The Python webframework Flask has the following syntax for routing expressions:

/foo/<var1>/bar/  # var1 is a string

/foo/var2:int/bar/ # var2 is matched iff it is parseable as int
/foo/var3:customtype/bar/ # var3 is matched against a custom type that has to be registered upfront

The whole typesystem is a thing I'd like to see in the Iron router middleware, but I'm primarily interested in the following:

/foo/<var4:path>/bar/

That route will match against:

  • /foo/baz/bar/, var4="baz"
  • /foo/baz/bam/bar/, var4="baz/bam"

and so on. I know that I can match against wildcards, but I need a way to access the matched path segments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions