From 1a5778f41441c024b25a4bb14cb9a07bfac15623 Mon Sep 17 00:00:00 2001 From: sodoku Date: Mon, 3 Jun 2019 20:21:05 +0200 Subject: [PATCH] Change to post --- server/route/matelight.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/route/matelight.js b/server/route/matelight.js index f0e7069..5182724 100644 --- a/server/route/matelight.js +++ b/server/route/matelight.js @@ -1,14 +1,15 @@ require('isomorphic-fetch'); module.exports = (router) => { - router.get('/matelight/:command', async (ctx) => { + router.post('/matelight/:command', async (ctx) => { const { command } = ctx.params; const res = await fetch(`http://matelight.cbrp3.c-base.org/api/${command}`); ctx.assert((res.status === 200), res.status); const body = await res.json(); ctx.body = body; }); - router.get('/matelight/:command/:argument', async (ctx) => { + router.post('/matelight/:command/:argument', async (ctx) => { + console.log(ctx) const { command, argument } = ctx.params; const res = await fetch(`http://matelight.cbrp3.c-base.org/api/${command}/${argument}`); ctx.assert((res.status === 200), res.status);