Skip to content
This repository was archived by the owner on Oct 10, 2026. It is now read-only.

Commit 1a6b405

Browse files
committed
Adding helloworld
1 parent bcbcda6 commit 1a6b405

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

‎HelloWorld/helloWorld.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Call the console.log function.
2+
console.log("Hello World");

‎HelloWorld/helloWorldNode.js‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* http://howtonode.org/hello-node
3+
*/
4+
5+
// Load the http module to create an http server.
6+
var http = require('http');
7+
8+
// Configure our HTTP server to respond with Hello World to all requests.
9+
var server = http.createServer(function (request, response) {
10+
response.writeHead(200, {"Content-Type": "text/plain"});
11+
response.end("Hello World\n");
12+
});
13+
14+
// Listen on port 8000, IP defaults to 127.0.0.1
15+
server.listen(process.env.IP);
16+
17+
// Put a friendly message on the terminal
18+
console.log("Server running at "+process.env.IP+':'+process.env.PORT);

0 commit comments

Comments
 (0)