How to use nodemon with .env files?

  1. Install dotenv npm i dotenv
  2. Create .env file and your variables inside
  3. Add the script to execute

    "dev": "nodemon -r dotenv/config ./app/index.js " or
    "start": "node -r dotenv/config ./app/index.js "
    
  4. Run the app using npm run dev or npm run start

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)