-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
32 lines (24 loc) · 924 Bytes
/
Copy pathserver.js
File metadata and controls
32 lines (24 loc) · 924 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
31
32
const express=require("express");
const https=require("https");
var cors = require('cors')
//const bodyparser=require("body-parser");
const app=express();
app.use(cors())
var voter=[];
function addVoter(nid, name, age, gender){
voter.push({nid:nid, name:name, age:age, gender:gender});
}
addVoter('1234567890', "Abdur Rahman", 35, "male");
addVoter('2411896197', "Yusuf Jalil", 27, "male");
addVoter('1849461535', "Ranjit Chandra Das", 62, "male");
addVoter('4998162303', "Humaira Begum", 43, "female");
addVoter('9849881656', "Partha Gomez", 39, "male");
addVoter('9844951666', "Afia Khatun", 56, "female");
addVoter('1698481568', "Priti Chowdhury", 78, "female");
addVoter('8498116799', "Motahera Jahan", 19, "female");
app.get("/get_voter", (req, res) => {
res.send(voter);
});
// start the server listening for requests
app.listen(process.env.PORT || 4000,
() => console.log("Server is running..."));