Skip to content

Commit 1438231

Browse files
Update endpoints
1 parent 93f6d8f commit 1438231

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

index.js

+22-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
11
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';
44

55
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+
);
824
const response = {
925
statusCode: 200,
1026
body: JSON.stringify('Request started.'),
1127
};
1228
return response;
1329
};
1430

31+
startRequest()
32+
1533
exports.handler = startRequest;

0 commit comments

Comments
 (0)