falconry / falcon

The no-magic web data plane API and microservices framework for Python developers, with a focus on reliability, correctness, and performance at scale.
https://falcon.readthedocs.io/en/stable/
Apache License 2.0
9.51k stars 936 forks source link

URL template for path #263

Closed hanjianwei closed 8 years ago

hanjianwei commented 10 years ago

I'm building a RESTful file server which supports listing a specified folder. To build such url template I need put folder path in url. I found the following things from RFC 6570:

{+path}/here          /foo/bar/here

In my case it should be:

api.add_route('/api/files/{+dir}', file_api)

But this is level 2 template while falcon's document says:

Currently only Level 1 templates are supported. See also RFC 6570.

Is there anyway to do this?

Related issue: #35

Thanks

leahfitch commented 9 years ago

I suggest adding support just for reserved variable expansion rather than the complete level 2 spec. I've made some changes to support this feature here: 6f263caa00a9e563c24e37a14f71a608c82e5d9d