Skip to content

Add in support for route variables #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2019
Merged

Add in support for route variables #2

merged 1 commit into from
Oct 28, 2019

Conversation

mscosti
Copy link
Owner

@mscosti mscosti commented Oct 27, 2019

Similar to flask and other web app frameworks, this adds support for adding in generic variables in your route definitions. On incoming HTTP request, if a path matches a route template that has some variables in it, it will parse out those variables, and then pass them along to the request handler as arguments to the function.

example:

@app.route('/customer/<id>')
def getCustomer(environ, id):
    ...

important to note: If you have multiple variables in your path, then the order that your function receives those variables is the order in which they are defined in the route template.

@mscosti mscosti merged commit 249d3c0 into master Oct 28, 2019
@mscosti mscosti deleted the routeVars branch October 28, 2019 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant