addLiveRoute
addLiveRoute(path: String;
coll: Collection;
templateName: StringUtf8;
authObject: Object;
authenticationMethod: Method) typeMethod;
The addLiveRoute method of the Orb class specifies a route that actions global live updates. This means that all users will see the same data from the same collection.
This method specifies that the URL specified by the path parameter should automatically start live updates on the target collection specified by the coll parameter.
Objects added to the collection are expanded by the templating engine, using the template specified by the templateName parameter.
All users are sent the same data in live changes to this route; for example, if the templateName parameter specifies a dynamic template or contains directives that causes data to display dynamically, what is sent to each specific connection is undefined.
If the authObject parameter is not null, whenever the live route is accessed, the method specified by the authenticationMethod parameter is called with the object specified by the authObject parameter as the receiver. If the authenticationMethod method returns false, the request is denied.
This method is provided for convenience for specific use‑cases where all connected users should see the same data; for example, a live stock ticker could be implemented using this method.
Use of this method is discouraged, and it is instead recommended to specify a normal route with the addRoute method and manually start live updates with the liveUpdate method. This gives you more control over the routing, authentication, and response.
