title: confused of nodejs express .env / config file settings
body: <p>I have 2 questions, and I am asking two questions together since it is related to each other.</p>
  
  <p>I am using sequelize-cli for migration, (I used sync({force: true}) before)</p>
  
  <p>when I use the command</p>
  
  <pre><code>sequelize init
  </code></pre>
  
  <p>the config/config.json is created, and that json file is structured in the way of key-value pair, development / test / production.</p>
  
  <pre><code>// like below
  
  {
      "development": {
  
      },
      "test": {
  
      },
      "production": {
  
      }
  }
  </code></pre>
  
  <p>Before using sequelize migration, I had no idea of the concepts of development, test, production, thus I searched the articles about this concepts.</p>
  
  <p>As a result, I have learned that it is recommended to set either NODE_ENV to development or production (or test).</p>
  
  <p>My issue starts from here.</p>
  
  <p>First, I used to use .env file only, with variables set inside that file (Before using sequelize migration, I had no experience using config folder. I used .env file only.)</p>
  
  <p>since this was my first time using config.js file, I could not distinguish the role between .env file and config file.</p>
  
  <p>So, while reading,</p>
  
  <p><a href="https://stackoverflow.com/questions/5869216/how-to-store-node-js-deployment-settings-configuration-files">How to store Node.js deployment settings/configuration files?</a></p>
  
  <p>I saw that process.env.something (to use variables set in .env file) being used inside the config file.</p>
  
  <p>below is the code,</p>
  
  <pre><code>//config.js
  
  config.twitter.user_name = process.env.TWITTER_USER || 'username';
  config.twitter.password=  process.env.TWITTER_PASSWORD || 'password';
  </code></pre>
  
  <p><strong>So the first question is that the .env file only set some secret variables, and config file uses that .env file(with process.env.) thus ultimately all the settings of my express application is inside of config file?</strong></p>
  
  <p>I am confused with the structure that seperates config file, and .env file.</p>
  
  <p>I also read the article </p>
  
  <p><a href="https://goenning.net/2016/05/13/how-i-manage-application-configuration-with-nodejs/" rel="nofollow noreferrer">https://goenning.net/2016/05/13/how-i-manage-application-configuration-with-nodejs/</a></p>
  
  <p>according to that article,</p>
  
  <p>there are development.js, production.js, test.js files inside of config folder.</p>
  
  <p>but as I mentioned above, config.json file created from the command "sequelize init", has a key-value pair. (development, test, production).</p>
  
  <p>vice versa, the article just above shows that config folder has files each for development, test, production.</p>
  
  <p><strong>So my second question is that, do I have to delete that config.json file which was created from "sequelize init" command, and integrate them to each files? (there may be no 100% correct-answer, but I want to know the most-widely-used and efficient way)</strong></p>
  
  <p>From now on, I even do not know how to setup the NODE_ENV, but I will keep searching for it.</p>
  
  <p>Thanks for reading this long question, and it would be really appreciated to give me some advice on this issue.</p>