Book Image

Meteor Cookbook

By : Isaac Strack
Book Image

Meteor Cookbook

By: Isaac Strack

Overview of this book

Table of Contents (19 chapters)
Meteor Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Implementing multiserver DDP


The fun doesn't stop with a single client and server DDP connection. Oh no! Indeed, Meteor has invited everybody to the DDP party, and in this recipe, we're going to see how two Meteor servers can speak to each other using DDP.

Getting ready

We will be using the code base from the Using client-only collections recipe, found in this chapter. Please create an instance of this project and start your meteor server.

For this project, we will change the color of the bookmark titles, based on whether the links are secure or not; so we need to make one change to our first project to make the color dependent on the secType property (which we will create in this recipe). Open the templateHelpers.js file, found in the [project root]/client/scripts folder of the first project. Locate the Template.urls.helpers section and make the following change to the selected function:

Template.urls.helpers({
    …
    selected: function () {
        return Session.equals('selMark', this...