title: How do we specify within a server environment which node.js start script to run?
body: <p>This may be a dumb question, but I'm stumped.</p>
  <p>I have 3 environments: Dev(local), Staging(remote) and Production(remote).</p>
  <p>I'm writing a relatively simply Express App.</p>
  <p>In my package.json file, I have specified start scripts for each of the 3 environments. Here's the full file:</p>
  <pre><code>{
    &quot;name&quot;: &quot;test-app&quot;,
    &quot;version&quot;: &quot;0.0.1&quot;,
    &quot;description&quot;: &quot;test utility app&quot;,
    &quot;private&quot;: true,
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;cross-env NODE_ENV=development nodemon ./bin/www&quot;,
      &quot;start:staging&quot;: &quot;cross-env NODE_ENV=staging nodemon ./bin/www&quot;,
      &quot;start:production&quot;: &quot;cross-env NODE_ENV=production &amp;&amp; nodemon ./bin/www&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;cross-env&quot;: &quot;^7.0.3&quot;
    },
    &quot;dependencies&quot;: {
      &quot;axios&quot;: &quot;^0.24.0&quot;,
      &quot;config&quot;: &quot;^3.3.6&quot;,
      &quot;cookie-parser&quot;: &quot;~1.4.4&quot;,
      &quot;cors&quot;: &quot;^2.8.5&quot;,
      &quot;debug&quot;: &quot;~2.6.9&quot;,
      &quot;dotenv&quot;: &quot;^8.2.0&quot;,
      &quot;express&quot;: &quot;^4.17.1&quot;,
      &quot;http-errors&quot;: &quot;~1.6.3&quot;,
      &quot;jade&quot;: &quot;~1.11.0&quot;,
      &quot;morgan&quot;: &quot;~1.9.1&quot;,
      &quot;nodemon&quot;: &quot;^2.0.15&quot;
    }
  }
  </code></pre>
  <p>Now, my question is, <strong>how do I specify which start script should be used in each remote server environment</strong>?</p>
  <p>I understand how to start the development environment, so ignore that and focus on Staging and Production.</p>
  <p>For example, I want the start:staging to be executed in Staging and the start:production to be executed in Production.</p>
  <p>I may be thinking about this incorrectly, so please let me know if I should be approaching the Staging and Production environments differently.</p>
  <p>It just seems to me the Staging and Production environments would have no idea which environment they should operate as without me assigning them as one or the other somehow.</p>
  <p>Maybe this is done as part of the workflow? I'm using github actions for build/deployment, fyi.</p>
  <p><strong>Update</strong></p>
  <p>So, I did a little more digging. In the workflow file, there's a build step:</p>
  <pre><code> name: npm install, build, and test
          run: |
            npm install
            npm run build --if-present
            npm run test --if-present
  </code></pre>
  <p>Would I simply add something like: <strong>npm run start:staging</strong> or <strong>npm run start:production</strong> as appropriate?</p>