-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
30 lines (24 loc) · 890 Bytes
/
server.js
File metadata and controls
30 lines (24 loc) · 890 Bytes
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
const http = require('http');
const server = http.createServer(function(req, res){
// res.writeHead(200, {'content-type': 'text/plain'});
// res.writeHead(200, {'content-type': 'application/json'});
res.writeHead(200,{'content-type': 'text/html'} )
// res.end('Welcome to Zuri Internship');
// res.end(`
// {
// "name" : "Evans",
// "country" : "Ghana",
// "hobby" : "reading fiction"
// }
// `);
res.end(`
<html>
<body style= "background: black; color: white; text-align: center; padding: 300; font-weight: 600; line-spacing: 1.9; font-size: 25px;">
<h1>Welcome to Zuri Internship</h1>
<p>We demand utmost commitment and discipline.</p>
</body>
</html>
`);
});
server.listen(4000, 'localhost');
console.log("Server created successfully!");