You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the signature for Node.js functions is: function (hook).
It would be more clear to users and node.js friendly if the signature was: function(req, res).
The new function signature would actually be backwards compatible, so this wouldn't break any existing services. Update will be required in run-service npm package.
We could also consider function(req, res, next), but implementing next correctly might be non-trivial.
The text was updated successfully, but these errors were encountered:
We've got good progress on this in the service-as-middleware branch.
It appears we've got working support for function (req, res, next) signatures to the point where we can chain multiple services together as middlewares.
I've checked in some examples in service-as-middleware for putting a basicAuth service behind others services.
Should be merged into master after more testing downstream in hook.io.
Currently, the signature for Node.js functions is:
function (hook)
.It would be more clear to users and node.js friendly if the signature was:
function(req, res)
.The new function signature would actually be backwards compatible, so this wouldn't break any existing services. Update will be required in
run-service
npm package.We could also consider
function(req, res, next)
, but implementingnext
correctly might be non-trivial.The text was updated successfully, but these errors were encountered: