Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I edit on my server files without restarting nodejs when i want to see the changes?

I'm trying to setup my own nodejs server, but I'm having a problem. I can't figure out how to see changes to my application without restarting it. Is there a way to edit the application and see changes live with node.js?

like image 316
Robert Hurst Avatar asked May 28 '10 00:05

Robert Hurst


People also ask

How do I restart node server automatically?

Nodemon is a package for handling this restart process automatically when changes occur in the project file. It will show the version of nodemon as shown in the below screenshot. Now, when we make changes to our nodejs application, the server automatically restarts by nodemon as shown in the below screenshot.

How node JS works on server-side?

Node. js is a JavaScript framework for writing server-side applications. In its simplest form it allows you to trigger small JavaScript programs from the command line without any browser involved. For example, assuming node is installed if you write a JavaScript program in a file called hello.

How do you run a node js file on a server?

The usual way to run a Node. js program is to run the globally available node command (once you install Node. js) and pass the name of the file you want to execute. While running the command, make sure you are in the same directory which contains the app.


1 Answers

Nodules is a module loader for Node that handles auto-reloading of modules without restarting the server (since that is what you were asking about):

http://github.com/kriszyp/nodules

Nodules does intelligent dependency tracking so the appropriate module factories are re-executed to preserve correct references when modules are reloaded without requiring a full restart.

like image 134
Kris Zyp Avatar answered Nov 02 '22 21:11

Kris Zyp