From 4a01fe4b3b0fc435db54637b4f77e829bab741a1 Mon Sep 17 00:00:00 2001 From: smedmunds Date: Fri, 16 Dec 2022 14:05:56 -0600 Subject: [PATCH 1/2] Testing WoL --- api/server.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/server.js b/api/server.js index db150612..f6bde986 100644 --- a/api/server.js +++ b/api/server.js @@ -2,7 +2,7 @@ const express = require("express"); const bodyParser = require("body-parser"); const cors = require("cors"); const fs = require("fs"); - +const wol = require("wol") try { var links = require('../src/links.json'); @@ -95,7 +95,11 @@ app.post("/sui/api/appUpdate", jsonParser, (req, res) => { res.status(200).send(applications.apps) }); - +app.post("/sui/api/wakeDakota", (req, res) => { + wol.wake('18:C0:4D:81:57:68', function(err, res){ + console.log(res); + }); +}); // app is listening on port 5000 app.listen(5000, () => { From ea8d98b940a670c6bc80b05d157ace8cd27f38ff Mon Sep 17 00:00:00 2001 From: smedmunds Date: Fri, 16 Dec 2022 14:53:01 -0600 Subject: [PATCH 2/2] Switched to get instead of post for wol --- api/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/server.js b/api/server.js index f6bde986..cb4c3b71 100644 --- a/api/server.js +++ b/api/server.js @@ -95,7 +95,7 @@ app.post("/sui/api/appUpdate", jsonParser, (req, res) => { res.status(200).send(applications.apps) }); -app.post("/sui/api/wakeDakota", (req, res) => { +app.get("/sui/api/wakeDakota", (req, res) => { wol.wake('18:C0:4D:81:57:68', function(err, res){ console.log(res); });