Skip to content

Remove dotenv and nodemon and switch to native Node.js environment handling [express-mvc-esm] #71

@MehediMubin

Description

@MehediMubin

Description

Currently, the project uses dotenv to load environment variables and nodemon to watch for file changes during development. With Node.js now supporting native environment variable loading and --watch mode, we can simplify the project setup by removing these dependencies.

Expected Behavior

  • The application should run correctly using:
    node --env-file=.env --watch ./src/server.js
  • Environment variables are read directly by Node.js without requiring dotenv.
  • Development workflow does not depend on nodemon.
  • package.json no longer lists dotenv or nodemon as dependencies.

Proposed Solution

  • Remove dotenv and nodemon from package.json.
  • Update config/index.js (and any other files) to use Node.js's native process.env directly, without dotenv.
  • Update the start script in package.json to:
"start": "node --env-file=.env --watch ./src/server.js"
  • Test the app to ensure it runs correctly with the new setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions