https post

This commit is contained in:
barwie2@st.amu.edu.pl 2020-03-09 19:58:58 +01:00
parent 02f9bc14a6
commit 92361347d3

View File

@ -24,16 +24,16 @@ var server = http.createServer(function (request, response) {
});
try {
request.on('end', function () {
body = body.split("&");
body = JSON.parse(body);
var send_array = {
"type": "data",
"id": body[1],
"name": body[2],
"surname": body[3],
"classes_code": body[0]
"id": body.student_index,
"name": body.student_name,
"surname": body.student_surname,
"classes_code": body.classes_code
};
console.log(body);
lookup[body[0]].send(JSON.stringify(send_array));
lookup[body.classes_code].send(JSON.stringify(send_array));
});
} catch (e) {console.log(e)}
}