https post
This commit is contained in:
parent
6ab5679bde
commit
391ed435b9
@ -24,6 +24,7 @@ var server = http.createServer(function (request, response) {
|
||||
});
|
||||
|
||||
request.on('end', function () {
|
||||
try {
|
||||
body = JSON.parse(body);
|
||||
var send_array = {
|
||||
"type": "data",
|
||||
@ -34,6 +35,9 @@ var server = http.createServer(function (request, response) {
|
||||
};
|
||||
lookup[body.classes_code].send(JSON.stringify(send_array));
|
||||
response.end("Added");
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
@ -42,10 +46,6 @@ var server = http.createServer(function (request, response) {
|
||||
}
|
||||
});
|
||||
|
||||
server.on('error', function (e) {
|
||||
console.log(e);
|
||||
});
|
||||
|
||||
var http_port = 8889;
|
||||
server.listen(http_port);
|
||||
console.log("HTTP server running on port " + http_port);
|
||||
|
Loading…
Reference in New Issue
Block a user