-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
before route? #26
Comments
currently, that is not supported. Are you looking to run something before every route or before a specific route? |
Hello @jgallen23 Thanks for your quick reply. The Intent is to implement a function to be called before all routes. You suggest something? |
sounds like a good feature. would you be willing to do a pull request? |
I developed the same thing, very similar to Gallen library. Maybe you're interested. |
@ramiel fantastic! I see. I will download it and use. Thanks |
I planned to add middleware for both before & after but i cant execute the tests properly. It seems like you have moved from Make to Grunt but not updated the docs? |
yeah, I need to update the docs, I'll work on that |
Ok, I solve this using a wrapper fabric function: var middleware = function (fn) {
return function () {
console.log('Middleware in action!');
fn.apply(null, arguments)
}
}
routie({
'path_to_route/:id': middleware(function (id) {
// code...
console.log('Params ok!', id)
})
}) |
Hi,
have some method as before route where I can implement a logic before routing?
thank you
The text was updated successfully, but these errors were encountered: