All files constants.js

100% Statements 52/52
100% Branches 9/9
100% Functions 4/4
100% Lines 52/52

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 531x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 12x 12x 1x 11x 11x 1x 33x 1x 1x 32x 32x 32x 33x 1x 1x 3x 1x 1x 2x 2x 1x 1x 1x 1x 1x 1x 2x 3x 1x 1x 1x 1x 1x 1x 1x 1x  
/**
 * Constants for shared use
 *
 * Provides a constants object to access commonly needed
 * values that are shared across files.
 *
 * @author michael whobrey <mwhobrey@idealss.com>
 */
 
exports.constants = {
  messages: {
    handshake: '/meta/handshake',
    subscribe: '/meta/subscribe',
    connect: '/meta/connect'
  },
  isProduction: () => {
    return process.env.IDEAL_ENV === 'production';
  },
  isTesting: () => {
    return process.env.TESTING === 'true';
  },
  pubsubEndpoint: () => {
    if (process.env.IDEAL_ENV === 'production') {
      return 'https://pubsub.idealss.net/faye';
    }
    else {
      return 'https://pubsub-test.idealss.net/faye';
    }
  },
  mongo: {
    connectionUri: () => {
      if (process.env.IDEAL_ENV === 'production') {
        return "mongodb://10.132.59.171:27017/";
      }
      else {
        if (process.env.TESTING === 'true') {
          return "mongodb://127.0.0.1:27017/";
        }
        else {
          // return "mongodb://127.0.0.1:27017/";
          return "mongodb://10.132.224.79:27017/";
        }
      }
    }
  },
  clientStates: {
    unconnected:  1,
    connecting:   2,
    connected:    3,
    disconnected: 4,
  }
}