I have the following in my script:
var server = http.createServer(handleRequest);
server.listen(3000, function(err){
console.log(err || 'Server listening on 3000');
});
When I execute the script in the terminal:
nodejs file.js
It runs in an endless loop until I hit Ctrl + C. Is it possible to enter custom commands while the process is running since it doesn't go back to the default terminal? I would like to add a few custom commands to my app such as (but not limited to):
- stop
- reload
- restart