ignore http methods

main
Filip Borum Poulsen 1 year ago
parent fd5051e35d
commit 7569797729

@ -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}`;

Loading…
Cancel
Save