File tree 1 file changed +22
-4
lines changed
1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 1
1
const fetch = require ( 'node-fetch' ) ;
2
- const DEFAULT_API_ENDPOINT_FEATURES = 'http://localhost:4683/api/v1/wifis/get /reloadFeatureCache' ;
3
- const DEFAULT_API_ENDPOINT_HEAT_MAP = 'http://localhost:4683/api/v1/wifis/get/realoadHeatmapData ' ;
2
+ const DEFAULT_API_ENDPOINT_FEATURES = 'http://localhost:4683/api/v1/wifis/patch /reloadFeatureCache' ;
3
+ const DEFAULT_API_ENDPOINT_HEAT_MAP = 'http://localhost:4683/api/v1/wifis/patch/reloadHeatmapData ' ;
4
4
5
5
const startRequest = async ( ) => {
6
- fetch ( process . env . API_ENDPOINT ?? DEFAULT_API_ENDPOINT_FEATURES ) ;
7
- fetch ( process . env . API_ENDPOINT ?? DEFAULT_API_ENDPOINT_HEAT_MAP ) ;
6
+ fetch (
7
+ process . env . API_ENDPOINT ?? DEFAULT_API_ENDPOINT_FEATURES ,
8
+ { method : 'PATCH' } ,
9
+ ( err ) => {
10
+ if ( err ) {
11
+ console . log ( err ) ;
12
+ }
13
+ } ,
14
+ ) ;
15
+ fetch (
16
+ process . env . API_ENDPOINT ?? DEFAULT_API_ENDPOINT_HEAT_MAP ,
17
+ { method : 'PATCH' } ,
18
+ ( err ) => {
19
+ if ( err ) {
20
+ console . log ( err ) ;
21
+ }
22
+ } ,
23
+ ) ;
8
24
const response = {
9
25
statusCode : 200 ,
10
26
body : JSON . stringify ( 'Request started.' ) ,
11
27
} ;
12
28
return response ;
13
29
} ;
14
30
31
+ startRequest ( )
32
+
15
33
exports . handler = startRequest ;
You can’t perform that action at this time.
0 commit comments