镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Update node.js function signature #25

Open

Description

@Marak

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.

Activity

  1. self-assigned this
    on Jan 20, 2017
  2. Marak commented on Feb 24, 2017

    @Marak
    CollaboratorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions