Skip to content

bug: adding nodemon to dependencies to make the backend server rerun automated #1038

@tejinderpa

Description

@tejinderpa

Problem

Developers currently have to manually restart the backend Node.js server every time a code change is made during development, which slows down the workflow.

Current Behavior

When making changes to backend files (like server.js, controllers, or routers), the server keeps running the old code. We have to manually stop the server (Ctrl+C) and run node server.js again to see the updates.

Expected Behavior

The backend server should automatically detect file saves and restart itself seamlessly, allowing immediate testing of new changes.

Steps to Reproduce

  1. Start the backend server using node server.js
  2. Make a visible change in any backend file (e.g., modifying an API response in server.js)
  3. Save the file
  4. Test the API and see that the old response is still returned because the server didn't restart.

Screenshots

Not applicable.

Environment

  • Environment: Local Development (Node.js)
  • OS: Windows / macOS / Linux

Additional Context

We should install nodemon as a development dependency to solve this.
Proposed solution:

  1. Run npm install --save-dev nodemon
  2. Add a dev script to package.json:
    "scripts": { "dev": "nodemon server.js", "start": "node server.js" }
  3. Developers can then just run npm run dev to start the server with hot-reloading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions