-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
33 lines (30 loc) · 812 Bytes
/
index.js
File metadata and controls
33 lines (30 loc) · 812 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const fetch = require('node-fetch');
const DEFAULT_API_ENDPOINT_FEATURES = 'http://localhost:4683/api/v1/wifis/patch/reloadFeatureCache';
const DEFAULT_API_ENDPOINT_HEAT_MAP = 'http://localhost:4683/api/v1/wifis/patch/reloadHeatmapData';
const startRequest = async () => {
fetch(
process.env.API_ENDPOINT ?? DEFAULT_API_ENDPOINT_FEATURES,
{method: 'PATCH'},
(err) => {
if (err) {
console.log(err);
}
},
);
fetch(
process.env.API_ENDPOINT ?? DEFAULT_API_ENDPOINT_HEAT_MAP,
{method: 'PATCH'},
(err) => {
if (err) {
console.log(err);
}
},
);
const response = {
statusCode: 200,
body: JSON.stringify('Request started.'),
};
return response;
};
startRequest()
exports.handler = startRequest;