?
Solved

node.js newbie - running example.js

Posted on 2014-08-12
2
Medium Priority
?
257 Views
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, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');

Open in new window



Thanks for helping me out.  : )
0
Comment
Question by:Tom Knowlton
  • 2
2 Comments
 
LVL 5

Accepted Solution

by:
Tom Knowlton earned 0 total points
ID: 40256165
Apologies...my file was created as example.js.txt

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

Author Closing Comment

by:Tom Knowlton
ID: 40256168
: /
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month16 days, 1 hour left to enroll

850 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