Nbsp = {};

Nbsp.updateColor = function() {
  var red = Session.get('red'),
      green = Session.get('green'),
      blue = Session.get('blue');
  $('body').css({
    'background-color': 'rgb(' + red + ', ' + green + ', ' + blue + ')'
  });
}

if (Meteor.isClient) {

  Session.setDefault('red', 0);
  Session.setDefault('green', 0);
  Session.setDefault('blue', 0);

  Template.form.onCreated(function() {
    Nbsp.updateColor();
  });

  Template.form.helpers({
    counter: function () {
      return Session.get('counter');
    }
  });

  Template.form.events({
    'change input': function (event) {
      Session.set(event.target.id, event.target.value)

      Nbsp.updateColor();

      $('')
    }
  });
}

if (Meteor.isServer) {
  Meteor.startup(function () {
    // code to run on server at startup
  });
}

@@ -684,21 +684,8 @@
 r();
-%0A%0A      $('')
 %0A   
@@ -758,43 +758,247 @@
     
-// code to run on server at startup
+let hueSettings = Meteor.settings.hue %7C%7C Meteor.settings.public.hue;%0A    if (!hueSettings) %7B%0A      throw new Meteor.Error(500, %22Hue credentials not available.%22);%0A    %7D%0A    Nbsp.hue = new HueBridge(hueSettings.server, hueSettings.username);
 %0A  %7D

Initialize Hue service at startup