title: Environment variable in Javascript (Gulp)
body: <p>I have a <strong>local development</strong> machine and a <strong>test server</strong>.
  Now I have an APP_ID that's being used in Javascript. I've been looking into ways that they kan differ on my local machine and on the test server.</p>
  
  <h3>Using Gulp</h3>
  
  <p>With gulp it's possible to add a flag on the command line:</p>
  
  <pre><code>gulp build --env=production
  </code></pre>
  
  <p>That way I can get the correct APP_ID from a file.
  <strong>The only issue is with this approach I need to run my build on the server, at this moment I run gulp locally and upload the changes to my server</strong></p>
  
  <p>Is it okay to build on the server? Are there other ways to use environment variables in Javascript?</p>