title: Environment variables validation in heroku app
body: <p>Do I need to make a validation of environment variable before using it in heroku app ?</p>
  
  <p>As a usual programming practice we should do validation of anything that could be wrong but specific technologies could have theirs own idioms and I'm interesting in best practices for apps that are deployed on heroku.</p>
  
  <p>For example in express application if validation is performed then I display error page with the name of uninitialized variable:</p>
  
  <pre><code>app.get('/login', function(req, res) {
      if (!process.env.OAUTH2_SERVER) {
          res.render('env_error', { envVar : 'OAUTH2_SERVER' });
      } else {
          res.render('login', { oauth2Server : process.env.OAUTH2_SERVER});
      }
  });
  </code></pre>
  
  <p>and without validation it looks like this:</p>
  
  <pre><code>app.get('/login', function(req, res) {
      res.render('login', { oauth2Server : process.env.OAUTH2_SERVER}); 
  });
  </code></pre>