node-restful
node-restful copied to clipboard
Before middleware called several times
If you define a custom route without any methods, for example: Resource.route('recommend', fn); and you define a 'before' middleware, for example: Resource.before('recommend', fn); the before middleware is called 4 times when you make one GET request to /resources/recommed.
We actually have tests that assert they're only called once.
Part of the problem might be that you're registering the same function fn? That function will get called twice -- once to handle the route and once before the route. Your example doesn't actually make sense to me...