-
Notifications
You must be signed in to change notification settings - Fork 1
/
tutorial1.js
59 lines (49 loc) · 1.46 KB
/
tutorial1.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Here We have actually created our development server on which i have hosted my html document.
// The server is created at host 127.0.0.1 and port number 3000.
// So to access this code we have to run server at this port.
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer ((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/html');
res.end(`<!DOCTYPE html>
<html>
<head>
<style>
.center {
margin : auto ;
text-align: center;
border: 2px solid black ;
border-radius :10px ;
background-color: lightgreen ;
font-weight: bold;
font-color: black ;
}
.center1 {
margin : auto;
text-align: center;
border: 1px solid black ;
border-radius: 10px;
background-color: lightgray;
font-weight: bold;
font-color: black ;
}
</style>
<body>
<div class = "center">
<p> Mera Naam Yash Mathur Hai. </p>
<p> Main Duniya Ki Sabse Badi Software Company Kholunga. </p>
<p> Mujhe Coding Karna Bohot Pasand Hai. </p>
</div>
<br>
<div class = "center1">
<p> Main Mehnat Karne Se Kabhi Darta Nahi Hun. </p>
<p> Main Ek Idea Par Itna Vishwaas Nahi Karta. </p>
<p> Par Mujhe Koi Idea Bata De Toh Main Use Implement Bohot Badhiya Se Karta Hun </p>
</div>
`);
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});