node.js newbie - running example.js

Posted on 2014-08-12
Last Modified: 2014-08-12
I've installed node.js.

I created a file named example.js  (as specified on the node.js home page online) and placed it in my root C:\

Then executed the following:

node attempt

1)  LOL ... how do I get rid of the ... that appears no matter what I type?  And what does the ... mean to me?

2)  How do I properly run this command:    % node example.js

Here is the content of C:\example.js:

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, '');
console.log('Server running at');

Open in new window

Thanks for helping me out.  : )
Question by:knowlton
    LVL 5

    Accepted Solution

    by: file was created as example.js.txt

    I renamed it to example.js and now it works.
    LVL 5

    Author Closing Comment

    : /

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Using Quotation Marks in PHP This question ( seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
    JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
    This video teaches users how to migrate an existing Wordpress website to a new domain.
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now