-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 40d981d
Showing
12 changed files
with
502 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# NodeJS - Day 1 - Introduction | ||
|
||
👀 It contains Introduction for NodeJS 👀 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`); | ||
}); |
Oops, something went wrong.