Verzeo Minor Project

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

JS File(app.

js)

var http = require('http');


var fs = require('fs');

function onRequest(request,response) {
response.writeHead(200,{'Content-Type': 'text/plain'});
response.readFile('./index.html',null,function(error,data){
if(error){
response.writeHead(404);
response.write('File not found!');
} else {
response.write(data);
}
response.end();
});
response.end();
}

http.createServer(onRequest).listen(5050);
console.log('Server Started listening on 5050');

HTML File(index.html)
<!DOCTYPE html>
<html>
<head>
<title>
Verzeo Minor Project
</title>
</head>
<body>
<h1>Verzeo Minor Project</h1>
<p>
This paragraph
contains a lot of lines
in the source code,
but the browser
ignores it.
</p>
<table>
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td>
</tr>
</table>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>

<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
</body>
</html>

You might also like