@metreeca/gate - v0.12.0
    Preparing search index...

    Function worker

    • Serves an asynchronous action as a worker.

      Every request reaching the handler runs the action, whatever its method and content. The response is sent only once the action settles, so the caller waits for the whole run to complete before learning its outcome.

      A completed action is acknowledged with an empty 200 OK. A rejected action is passed on to the error middleware of the surrounding stack, which is then responsible for the error response and the status code it carries.

      The handler performs no authentication of its own: access control is left to the surrounding stack.

      Parameters

      • handler: () => Promise<unknown>

        The action to run on each request; its result is discarded

      Returns RequestHandler

      A handler running the action on every request it receives, to be mounted on a dedicated route