Use of apiServerLabel and server selection - halacious doesn't work with multiple connections
There is a problem when using the halacious plugin on a server configured with multiple connections.
-
internals.routecall toserver.lookup()fails because it is not allowed on multiple connections. I'm not sure of other use cases but for me, my public API is specified with theapiServerLabeloption (which are the links I want to present, no matter which connection I receive a request on) so I have changed the call toselection.lookup(). -
I'm not sure of the reason for
selection.ext('onPostHandler', internals.postHandler);usingselectionand notserver. The pluginserver.register()call already has an option to select which connections the plugin should apply to so usingselectionhere seems like an error or redundancy at best. I have changed it toserver.ext('onPostHandler', internals.postHandler);which allows me to use halacious on multiple connections but lookup routes on the canonicalapiServerLabelconnection.
These changes are in https://github.com/Clarify/halacious/tree/use-apiServerLabel-for-route-lookup If it seems useful, I can make a PR.