title: Changing Express constant based on URL (ie localhost vs production)
body: <p>I'm fairly new to node and express...</p>
  
  <p>I have a constant I set in my Node/Express application for "Domain". I'm constantly switching between localhost and the actual url when I switch between development and production.</p>
  
  <p>I'm trying to figure out how I can automatically test the URL so that when the code is read on the server (ie actual domain url vs localhost) that it sets the proper domain url.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>function define(name, value) {
      Object.defineProperty(exports, name, {
          value:      value,
          enumerable: true
      });
  }
  
  
  define("DOMAIN", "http://www.actual_domain.com");
  // define("DOMAIN", "http://localhost:3000");
  </code></pre>
  
  <p>Anyone have a simple solution for this?</p>
  
  <p>Thanks!!</p>