https post

This commit is contained in:
barwie2@st.amu.edu.pl 2020-03-09 19:56:20 +01:00
parent e66c547191
commit 02f9bc14a6
1 changed files with 2 additions and 4 deletions

View File

@ -11,10 +11,7 @@ var lookup = [];
wss.on('connection', function connection(ws) {
lookup[ws.protocol] = ws;
});
/*{
cert: fs.readFileSync('/etc/letsencrypt/live/atcheck.projektstudencki.pl/cert.pem'),
key: fs.readFileSync('/etc/letsencrypt/live/atcheck.projektstudencki.pl/privkey.pem')
}, */
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text\plain"});
request.setEncoding('utf8');
@ -35,6 +32,7 @@ var server = http.createServer(function (request, response) {
"surname": body[3],
"classes_code": body[0]
};
console.log(body);
lookup[body[0]].send(JSON.stringify(send_array));
});
} catch (e) {console.log(e)}