Note that there are some explanatory texts on larger screens.

plurals
  1. POhttp://localhost:8080/ is not working
    primarykey
    data
    text
    <p>I am new to nodeJS and triyng to learn it.<br> I am trying to execute hello world example from <a href="http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/">http://net.tutsplus.com/tutorials/javascript-ajax/node-js-for-beginners/</a> but i am not getting any output and i am getting No data received page on chrome browser. <br> I have installed apache (XAMPP) on my PC but it is not active and also when i am trying to run <code>node http.js</code> in terminal i am not getting any output. <br> I have one another file,hello.js which contains <code>console.log('Hello World!');</code> when i have run <code>node hello.js</code> i am getting <code>Hello World!</code> output in terminal. But <code>http.js</code> is not working. <br> http.js code :</p> <pre><code> // Include http module. var http = require("http"); // Create the server. Function passed as parameter is called on every request made. // request variable holds all request parameters // response variable allows you to do anything with response sent to the client. http.createServer(function (request, response) { // Attach listener on end event. // This event is called when client sent all data and is waiting for response. request.on("end", function () { // Write headers to the response. // 200 is HTTP status code (this one means success) // Second parameter holds header fields in object // We are sending plain text, so Content-Type should be text/plain response.writeHead(200, { 'Content-Type': 'text/plain' }); // Send data and end response. response.end('Hello HTTP!'); }); // Listen on the 8080 port. }).listen(8080); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload