remy / nodemon

Monitor for any changes in your node.js application and automatically restart the server - perfect for development
http://nodemon.io/
MIT License
26.26k stars 1.72k forks source link

config.env should be overridden by runtime env variables #2209

Closed oosawy closed 3 months ago

oosawy commented 3 months ago

Expected behaviour

Runtime environment variables expected to override the env defined in config.

Actual behaviour

Envs defined in config.env are always be set. Seeing dotenv etc. this is not the expected behavior.

Steps to reproduce

  1. make files nodemon.json
    {
      "env": {
        "APP_ENV": "development"
      }
    }

    index.js

    console.log(process.env.APP_ENV)
  2. run nodemon with env variable
    APP_ENV=local npx nodemon index.js
  3. see the output (ideally "local")
    development

If applicable, please append the --dump flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.

github-actions[bot] commented 3 months ago

:tada: This issue has been resolved in version 3.1.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: