-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathassign5.js
32 lines (27 loc) · 1 KB
/
assign5.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
const http=require('http');
const server =http.createServer((req,res)=>{
if(req.url=='/home')
{
res.write('<html>');
res.write('<head><title>My Server</title><head>')
res.write('<body><h1>Welcome Home</h1></body>')
res.write('</html>');
res.end();
}else if(req.url=='/about')
{
res.write('<html>');
res.write('<head><title>My Server</title><head>')
res.write('<body><h1>Welcome to about us Page</h1></body>')
res.write('</html>');
res.end();
}else if(req.url=='/node')
{
res.write('<html>');
res.write('<head><title>My Server</title><head>')
res.write('<body><h1>Welcome to Node js Project</h1></body>')
res.write('</html>');
res.end();
}
res.end();
});
server.listen(5000);