Important Note: When working in development mode, remember that each time you make changes to the code, you must save it and restart the server for those changes to take effect on the client side.
If you are new to nodejs (express), the "nodemon package" can be helpful. It allows changes made on the server side to be reflected on the client side without needing to constantly restart the server. Simply save your code after making updates.
You can find more information about nodemon here.
Alternatively, follow these steps:
Step 1: Install nodemon by running this command in the terminal
npm i nodemon
Step 2: Start the server using
nodemon <server file name>
eg.
nodemon index.js
Now any changes you make on the server will automatically reflect on the client side without the need to restart the server.