Home Reference Source Repository

es6/config.js

// Handles Dokku RethinkDB instances
if (process.env.RETHINKDB_URL) {
  const [url, port] = process.env.RETHINKDB_URL.match(/^rethinkdb:\/\/(.*?):(.*?)$/)
  process.env.RETHINKDB_HOST = url
  process.env.RETHINKDB_PORT = port
}

/**
 * main configuration read in for Wyst
 *
 * @memberof   Wyst
 *
 * @type       {Object}
 * @property   {Object}  rethinkdb                     rethinkdb config
 * @property   {String}  rethinkdb.host  [localhost]   the host for the rethinkdb instance
 * @property   {Integer} rethinkdb.port  [28015]       the port the rethinkdb instance
 * @property   {String}  rethinkdb.db    [wyst]        the database Wyst should use
 */
const config = {
  rethinkdb: {
      host   : process.env.RETHINKDB_HOST || 'localhost'
    , port   : process.env.RETHINKDB_PORT || 28015
    , db     : process.env.RETHINKDB_DB   || "wyst"
  }
}

export default config