Friday 19 May 2017

Run node.js on cpanel hosting server

It is a simple node.js code.

var http = require('http');
http.createServer(function(req, res) {
    res.writeHead(200, { 'Content-Type' : 'text/plain'});
    res.end('Hello World!');
}).listen(8080);

I uploaded it on cpanel hosting server and installed node.js and run it. If a server is normal server I can check script result by accessing 'http://{serverip}:8080'. But on cpanel is hosting domain and sub domain and every domain is matched by every sites. Even http://{serverip} is not valid url. How can I access my node.js result? Kindly teach me. Thanks. bingbing.



via bb14816

No comments:

Post a Comment