templates/hook.template.js
function add_service() {
    // Default configuration. Overrides can be defined in `config/avahi.js`.

    sails.log.info('Publishing service ' + config.name + ' (' + config.type + ') on port '+ config.port);
    group.AddService(
      avahi.IF_UNSPEC.value,
      avahi.PROTO_INET.value,
      0,
      config.name,
      config.type,
      config.domain,
      config.host,
      config.port,
      '',
      function(err) {
        if (err) {
          sails.log.error('DBus: Could not call org.freedesktop.Avahi.EntryGroup.AddService');
          return;
        }
        group.Commit();
      }
    );
  }
function add_service() {
    // Default configuration. Overrides can be defined in `config/avahi.js`.

    sails.log.info('Publishing service ' + config.name + ' (' + config.type + ') on port '+ config.port);
    group.AddService(
      avahi.IF_UNSPEC.value,
      avahi.PROTO_INET.value,
      0,
      config.name,
      config.type,
      config.domain,
      config.host,
      config.port,
      '',
      function(err) {
        if (err) {
          sails.log.error('DBus: Could not call org.freedesktop.Avahi.EntryGroup.AddService');
          return;
        }
        group.Commit();
      }
    );
  }
function add_service ( ) { // Default configuration. Overrides can be defined in `config/avahi.js`. sails . log . info ( 'Publishing service ' + config . name + ' (' + config . type + ') on port ' + config . port ) ; group . AddService ( avahi . IF_UNSPEC . value , avahi . PROTO_INET . value , 0 , config . name , config . type , config . domain , config . host , config . port , '' , function ( err ) { if ( err ) { sails . log . error ( 'DBus: Could not call org.freedesktop.Avahi.EntryGroup.AddService' ) ; return ; } group . Commit ( ) ; } ) ; }
Add our service definition.
Add our service definition .