File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
require ( 'isomorphic-fetch' ) ;
2
2
3
3
module . exports = ( router ) => {
4
- router . get ( '/matelight/:command' , async ( ctx ) => {
4
+ router . post ( '/matelight/:command' , async ( ctx ) => {
5
5
const { command } = ctx . params ;
6
6
const res = await fetch ( `http://matelight.cbrp3.c-base.org/api/${ command } ` ) ;
7
7
ctx . assert ( ( res . status === 200 ) , res . status ) ;
8
8
const body = await res . json ( ) ;
9
9
ctx . body = body ;
10
10
} ) ;
11
- router . get ( '/matelight/:command/:argument' , async ( ctx ) => {
11
+ router . post ( '/matelight/:command/:argument' , async ( ctx ) => {
12
+ console . log ( ctx )
12
13
const { command, argument } = ctx . params ;
13
14
const res = await fetch ( `http://matelight.cbrp3.c-base.org/api/${ command } /${ argument } ` ) ;
14
15
ctx . assert ( ( res . status === 200 ) , res . status ) ;
You can’t perform that action at this time.
0 commit comments