I want to run two node.js httpservers on different ports:
var http = require('http');
var dbserver = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write('<html><body><h2 align=center>TEST index.html.</h2></body></html>');
res.end();
});
dbserver.listen(8888);
var s = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.write('hello world');
res.end();
});
s.listen(8080);
I want to make android application that will connect to my Node.js server on port 8888 on AppFog hosting, send a message to the server, and receive a response from it. And if i open my server from browser i get just a simple html page. But my code doesn't works. Why?