nickel-org / nickel.rs

An expressjs inspired web framework for Rust
http://nickel-org.github.io/
MIT License
3.04k stars 157 forks source link

Chainable routes #262

Open flosse opened 9 years ago

flosse commented 9 years ago

Is it possible to do something like this:

server.route("/api/v0/foo")
  .get(middleware!{ ... })
  .post(middleware!{ ... })
  .put(middleware!{ ... });
Ryman commented 9 years ago

Not currently, would you like to try implementing it? It could be done by returning &mut Self for each of the methods in the HttpRouter trait (and updating anything that breaks)!

flosse commented 9 years ago

would you like to try implementing it?

I'll see.... at the earliest in 3 weeks :-\

Ryman commented 9 years ago

Reopening due to discussion on #270