Skip to content

Commit

Permalink
Content Added & Updated
Browse files Browse the repository at this point in the history
  • Loading branch information
prabhakaranthangavel committed Dec 14, 2023
0 parents commit 40d981d
Show file tree
Hide file tree
Showing 12 changed files with 502 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# NodeJS - Day 1 - Introduction

👀 It contains Introduction for NodeJS 👀
12 changes: 12 additions & 0 deletions async.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const fs = require('fs');

fs.readFile('./test.txt', 'utf-8', (err, data) => {
if (err) throw err;
console.log(data);
});

sayHello = () => {
console.log('hello');
}

sayHello(); // runs before the console.log(data)
25 changes: 25 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">;

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NodeJS - Day 1 - Introduction</title>
</head>

<body style="background-color: black;">

<marquee>
<br>
<br>
<br>
<br>
<br>
<h1 style="color: chartreuse;"><b>🌎This is a Introduction for NodeJS🌎</b></h1> <br><br>
<h2 style="color: red;">🔥<b>With npm packages</b>🔥</h2>
<h3 style="color: aqua;">🌴🌴<b>And Examples</b>🌴🌴</h3>
</marquee>

</body>

</html>
21 changes: 21 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Import the module http
const http = require('http');


// Define the server hostname and port number
const hostname = '127.0.0.1'; // local host IP Address
const port = 3000; // user defined


// create a server
const server = http.createServer( (req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
})


// Make the server to listen to the different port number
server.listen(port,hostname, () => {
console.log(`Server Running at http://${hostname}:${port}`);
});
Loading

0 comments on commit 40d981d

Please sign in to comment.