Skip to content
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

routes using @routerclass decorator #7

Closed
foodaemon opened this issue May 11, 2016 · 2 comments
Closed

routes using @routerclass decorator #7

foodaemon opened this issue May 11, 2016 · 2 comments

Comments

@foodaemon
Copy link

Very awesome project and i appreciate your great work. I am liking the project but the docstring based routing seems a bit unusual to me. Are you guys planning to keep it or change it to more simpler straight forward approach like other framework like falcon (another python framework to build REST API) does?
For the newbie programmers, would that be confusing and harder to debug?

@akubera
Copy link
Member

akubera commented May 11, 2016

I hadn't heard of Falcon before, thanks for pointing that project out.

The docstring routing is unusual, but I thought that was a good thing. It was inspired by the parsing rules in PLY, so there is precedence for using docstrings as more than metadata.

Does Falcon allow multiple mountpoints on a single object? It looks like you create an object and fix it to one point in the API, and you can differentiate HTTP verbs with methods on_get(...), on_post(...).

The alternative is using a bunch of decorators to specify the mount point

@mountpoint('/foo/bar')
def get_foobar(self, req, res):
    ...

vs

def get_foobar(self, req, res):
    """/foo/bar"""
    ...

I never really got around to thinking about how to implement @mountpoint; I invite you to (or anyone reading this ;-)) to fork growler and try to figure it out.

@foodaemon
Copy link
Author

I believe falcon does not support multiple mount point for a single object. The concept of @mountpoint decorator is a viable option. I will see if i can come up with something on this weekend. Again appreciate your response and your work. You can close this issue. Thanks!

@akubera akubera closed this as completed Jul 22, 2016
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

No branches or pull requests

2 participants