hfaran / Tornado-JSON

A simple JSON API framework based on Tornado
http://tornado-json.readthedocs.org/
MIT License
273 stars 60 forks source link

Customizable routing for argspec #57

Open hfaran opened 9 years ago

hfaran commented 9 years ago

From @kanoc in #45:

""" A more flexible routing system would be really nice, as the current implementation is severely limited. In a test project I ended up setting up the routes manually.

Besides the module names issue (which could be solved by Misaka42's proposal), it would be nice to have more options when generating routes with parameters that get passed to the HTTP methods. For example, imagine we have a resource (ID 123) that has a list of items and we want to have a Handler that gets one item (ID 456) and we need both the resource and item IDs. With current implementation the URL looks like /resource/123/456. It would be nice to have an URL /resource/123/item/456 instead. """

hfaran commented 9 years ago

Additionally, this should allow modification of the pattern (regex) to match terms in the URL (should define existing one as default kwarg and a constant).