title: How do I access environment variables in config SailsJS
body: <p>I'm trying to access my environment variables inside a config file. Can I use this variable inside a config?</p>
  
  <p><strong>For example</strong></p>
  
  <pre><code>// config/env/development.js
  module.exports = {
    appUrl: 'http://MY_DEV_PLACE/',
  }
  
  //config/passport.js
  var appUrl = appUrl || sails.config.appUrl  || 'localhost:1337'; //&lt;-- sails is not defined
  </code></pre>
  
  <p>I also tried in <code>local.js</code>:</p>
  
  <pre><code>// config/local.js
  module.exports = {
    gAPI: { secret: 'aaa'}
  }
  
  //config/passport.js
  var appUrl = gAPI || sails.config.gAPI  || 'some pass'; //&lt;-- sails is not defined
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>For <strong>appURL</strong> I'm using env like: <code>APP_URL=http://example.com/api sails lift</code></p>
  
  <p>For <strong>password</strong> I'm using:</p>
  
  <pre><code>var locals;
  
  try {
      locals = require('./local');
  } catch (e) {
      // not local so just ignore
  }
  
  module.exports.passport = {
      'GoogleAPI.Password': locals ? locals.gAPI.secret : ’some key'
  };
  </code></pre>