iam new to node.js am trying to creating a http server and spawn a child process.
see the code
var server = http.createServer(function(req, res) {
res.writeHead(200);
switch(req.url) {
case '/vm/start':
req.on('data', function(data) {
console.log("hello");
console.log(data.toString());
exec('CALin.exe', function(err, data) {
console.log(err)
console.log(data.toString());
});
res.end('');
});
});
break;
}
});
server.listen(9090);
console.log("Server running on the port 9090");
while i trying to run the above code using this url http://172.16.2.51:9090/vm/start am getting nothing.and browser showing connection reset problem
I dont know why this is happening
node server.js
Server running on the port 9090
res.end('');be in the exec callback ?