title: nodejs, Express Cannot GET /
body: <p>I try to run simplest Express code on Cloud server</p>
  
  <pre><code>var express = require('express');
  var app = express();
  app.get('/test', (req, res) =&gt; res.send('Hello ')); 
  app.listen( 3000 );  
  </code></pre>
  
  <p>I am getting the Apache  404  error : <code>GET /cood180119/projExpress1/demo1/test HTTP/1.0</code>,  Cannot GET /cood180119/projExpress1/demo1/test </p>
  
  <p>I have noticed that my url is <a href="http://77.xx.xx.xx/cood180119/projExpress1/demo1/test" rel="nofollow noreferrer">http://77.xx.xx.xx/cood180119/projExpress1/demo1/test</a></p>
  
  <p>while error logs shows IP : 88.xx.xx.xx.</p>
  
  <p>How to resolve? </p>
  
  <p>I have a node hello world example, which is working with the following url:</p>
  
  <p><code>http://77.xx.xx.xx/node-hello-world-master/</code></p>
  
  <p>where the file is in <code>public_html/node-hello-world-master/app.js</code>,</p>
  
  <p>but does not work with <a href="http://77.xx.xx.xx:3000/" rel="nofollow noreferrer">http://77.xx.xx.xx:3000/</a></p>
  
  <pre><code>const http = require('http');
  
  http.createServer(function(request, response) {
    response.writeHead(200, {'Content-Type': 'text/plain'});
    response.end("Hello, World!\n  port= ' + process.env.PORT);
  }).listen(process.env.PORT); //is says that port is undefined
  </code></pre>
  
  <p>I set the port=3000 in environmental node variables.
  After this, i can get the port number echoed , but i still can not access webpage using ttp://77.xx.xx.xx:3000/ </p>
  
  <p>Seems firewall is configured wrong. </p>