When using Express, it is possible to attach a callback array to a route like this:
app.get('/path', thisIsAnArrayOfFunctions);
And then, when making a request to http://route_to_server/path
each function inside thisIsAnArrayOfFunctions
is called.
Exactly how does that routing behaviour works in express? is it just an iteration through thisIsAnArrayOfFunctions
, passing the arguments req
, res
and next
?
Is it possible to achieve a simple implementation in Sails for this?
I know it works if I attach the routing as an express middleware, but I want to know if there's a solution using the Sails' (version 0.9.8) controller structure.
Thanks in advance.