nickel-org / nickel.rs

An expressjs inspired web framework for Rust

Home Page:http://nickel-org.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More than one middleware for one path?

JesusBarreda opened this issue · comments

Hi,

I would like to know if there is a way to apply more than one middleware to a resource. Maybe something similar to your "logger_middleware.rs" example but applying only for one resource because I suppose the sentence server.utilize(mw) applies "mw" to all server's resources.

It would be the expressjs pattern:

app.get('/path/to/something', mw1, mw2, ..., mwN, function(req, res) {
...
});

Thank you very much in advance.

I don't think we have a good story for this currently other than adding a bunch of things mounted under the same path which may be somewhat inefficient.