-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
26 lines (23 loc) · 729 Bytes
/
server.js
File metadata and controls
26 lines (23 loc) · 729 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
var http = require('http');
var server = http.createServer( function( request, response ) {
switch(request.url) {
case "/":
response.writeHead(200, {
'Content-Type': 'text/html'
});
response.write('This is Home Page.')
response.end();
break;
case "/student":
response.writeHead(200, {
'Content-Type': 'text/html'
});
response.write('<html><body><p>This is Student Page.</p></body></html>')
response.end();
break;
default:
response.end("Invalid Request!");
}
});
server.listen(5000);
console.log("Server Started on http://127.0.0.1:5000");