code: function (next) {
        var defaultConfig = {
          enabled: true,
          name: "Sails.js",
          type: "_sails._tcp",
          domain: "",
          host: "",
          port: sails.config.proxyPort || sails.config.port
        };
  
        // Merge default config with custom config.
        config = _.merge(defaultConfig, sails.config.avahi);
  
        // See if service publishing is desired
        if (!config.enabled) {
          return next();
        }
        // Get the avahi service from dbus.
        service = bus.getService(avahi.DBUS_NAME.value);
        service.getInterface(
          avahi.DBUS_PATH_SERVER.value,
          avahi.DBUS_INTERFACE_SERVER.value,
          function(
            err,
            newServer
          ) {
            server = newServer;
            server.on('StateChanged', stateChanged);
            server.GetState(function(err, state) {
              if (err) {
                sails.log.error('DBus: Could not call org.freedesktop.Avahi.Server.GetState');
                return;
              }
              stateChanged(state);
            });
          }
        );
  
  
        return next();
      }
docs: Run when sails loads-- be sure and call `next()`.