-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathstudent.js
40 lines (38 loc) · 930 Bytes
/
student.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
let student = [
{
"id": 1,
"name": "prabhat",
"class": "Diploma",
"email": "abc@gmail.com",
"mobile": "9999999990"
},
{
"id": 2,
"name": "prabhat",
"class": "Diploma",
"email": "abc@gmail.com",
"mobile": "9999999990"
},
{
"id": 3,
"name": "prabhat",
"class": "Diploma",
"email": "abc@gmail.com",
"mobile": "9999999990"
}
];
// const html = require("./index.html");
require('http').createServer((rq, rs) =>
{
// console.log(student);
// console.log(jsonData);
// rs.writeHead(200, { "Content-Type": "application/json" });
rs.writeHead(200, { "Content-Type": "text/html" });
// rs.write(JSON.stringify(student));
rs.write("html");
// rs.write(JSON.stringify(jsonData));
rs.end();
}).listen(8080, () =>
{
console.log("Server Started at port 8080");
})