From 756979772941eb1603ffd4607c6e86dc94e62b4b Mon Sep 17 00:00:00 2001 From: Filip Borum Poulsen Date: Sat, 7 Dec 2024 15:43:36 +0100 Subject: [PATCH] ignore http methods --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index e93cbfe..d9a0c2c 100644 --- a/index.js +++ b/index.js @@ -16,7 +16,7 @@ child_process.exec('pinctrl set 6 op'); child_process.exec('pinctrl set 13 op'); child_process.exec('pinctrl set 19 op'); -app.post('/on/:gpio', function (req, res) { +app.use('/on/:gpio', function (req, res) { const gpio = req.params.gpio; const command = `pinctrl set ${gpio} pn dh`; @@ -32,7 +32,7 @@ app.post('/on/:gpio', function (req, res) { }); }); -app.post('/off/:gpio', function (req, res) { +app.use('/off/:gpio', function (req, res) { const gpio = req.params.gpio; const command = `pinctrl set ${gpio} dl`; @@ -48,7 +48,7 @@ app.post('/off/:gpio', function (req, res) { }); }); -app.get('/status/:gpio', function (req, res) { +app.use('/status/:gpio', function (req, res) { const gpio = req.params.gpio; const command = `pinctrl get ${gpio}`;