1

I'm sure to the experts I will sound like a noob... very new to node.js. One of the thing I've just learnt is that I can start a basic server with something like this..

var http = require("http");

http.createServer(function(request, response) {
  response.writeHead(200, {"Content-Type": "text/plain"});
  response.write("Hello World");
  response.end();
}).listen(8888);

now i can access on cli with

$ node the-above-code.js

why can't the same be achieved on a shared server e.g. godaddy? What are the conceptual problems in that?

Ramesh Pareek
  • 1,601
  • 3
  • 30
  • 55
  • 3
    The first limit when you use a shared virtual host like Godaddy may be that it doesn't allow you to bind your app to listen to port like `8888`. Second of all a typical shared virtual host would not let you have access to install/change any system level dependencies so Node.js may not even exist or not exposed for you to access in the first place. – woozyking Mar 25 '16 at 05:11

1 Answers1

1

The problem is that godaddy doesn't let you change the apache settings to let you bind to port 8888. You would have to get yourself a private server to do that.

Refer to this thread: Why node.js can't run on shared hosting?

Community
  • 1
  • 1
Handonam
  • 618
  • 8
  • 17