redstone-dart / redstone

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

Enable routing to shelf_handlers #90

Closed wstrange closed 8 years ago

wstrange commented 9 years ago

Perhaps this just a documentation thing, but it is not obvious how to route to a shelf handler.

How do I arrange for a specific route to be handled by a shelf handler instead of a "redstone" handler?

Let's say I have a shelf oauth2 callback handler. I want "/oauth2/callback" to be handled by the shelf handler. The current mechanism seems to route to shelf only when all other handlers have been tried. If I have a bunch of shelf handlers, it is not clear to me how I integrate them with the routing mechanism.

luizmineo commented 9 years ago

Currently, there is no way to directly bind a shelf handler with a path, but you can wrap a shelf handler. Example:

@Route('/mypath')
myService() {
   return myShelfHandler(request.shelfRequest);
}

Let me know if that helps.