title: NodeJS autorefresh server
body: <p>Ok, I'm using <strong>NetBeans</strong> and I have this piece of code:</p>
  
  <pre><code>var express = require("express");
  var app = express();
  
  app.get("/", function (req, res) {
     res.send("Hi"); 
  });
  
  app.listen(8000);
  </code></pre>
  
  <p>When I click run file it starts listening on the port 8000. But, when I <strong>make a change</strong> and then <strong>run</strong> file again it <strong>cannot start</strong> listening on port 8000, because the previous one was not terminated. I have the option <strong>checked</strong> "Apply Code Changed on Save" in Options->HTML/JS->Node.js. How to refresh previously started server instead of starting the new one one?</p>