Client.js now transmits IP needed to connect to slaves

This commit is contained in:
Danielv123 committed 2016-12-27 11:15:53 +01:00
1 parent 26a9c4f1ef
commit c33ca4abec
3 files changed
+8 -3

No files matched your search

+3 -2
View File
@@ -52,10 +52,11 @@ app.post("/getID", function(req,res) {
// time us a unix timestamp we can use to check for how long the server has been unresponsive
// we should save that somewhere and give appropriate response
if(req.body){
slaves[req.body.unique] = req.body
console.log("Slave: " + req.body.mac + " : " + req.body.serverPort)
slaves[req.body.unique] = req.body;
console.log("Slave: " + req.body.mac + " : " + req.body.serverPort+" at " + req.body.publicIP);
}
});
// endpoint for getting information about all our slaves
app.get("/slaves", function(req, res) {
res.header("Access-Control-Allow-Origin", "*");