Skip to content

Mapping regex to function parameters #25

Open
@BenjamenMeyer

Description

@BenjamenMeyer

v0.8 introduced using regex to be able to register the end-point handler.
It could be useful, however, to use the regex functionality to assign portions of the URL to the functions parameters in order to not have to apply the regex twice.

The functions currently look like the following:

def my_handler(self, request, uri, headers)
      return (200, headers, 'hello')

Under this proposal, the functions could look like:

def my_handler(self, request, uri, headers, my_param1)
      return (200, headers, 'hello from {0}'.format(my_param1)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions