redstone-dart / redstone

A metadata driven microframework for Dart.
http://redstone-dart.github.io/redstone
MIT License
342 stars 42 forks source link

Add support for routes where parameters contain slashes #36

Closed OzzieOrca closed 10 years ago

OzzieOrca commented 10 years ago

I would like to have a route where everything past the base route would be included in the parameter, slashes and all. An example API might be:

@app.Route("/api/pages/:url", matchSubPaths: true)
pageData(String url){
    return url;
}

where a request such as GET: /api/pages/categoryName/pageName would match this route and return the response categoryName/pageName.

An example implementation of this in AngularDart is at https://github.com/angular/route.dart/pull/55

luizmineo commented 10 years ago

Redstone.dart v0.5.12 adds this feature.

To assign the requested subpath to a parameter, you need to add a trailing * character to the url template. See the wiki for more details.

If you have problems or doubts, please let me know.

OzzieOrca commented 10 years ago

You're awesome! Thanks for adding that so quickly :) It works great.