generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 1
/
seed.ts
30 lines (26 loc) · 978 Bytes
/
seed.ts
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
const host = 'http://localhost:3333';
async function main() {
const result = await fetch(`${host}/api/facilities/seed`)
.then((response) => response.json())
.catch(() => {
throw new Error(`The Script failed - make sure that the server is running on: ${host}`);
});
console.log(`success`);
console.log(`The server is running on: ${host}`);
console.log(
'You can now get all facilities by running: curl http://localhost:3333/api/facilities',
);
console.log(
'you can get a specific facility by running: curl http://localhost:3333/api/facilities/{assetId}',
);
console.log(
'You can get all time series data by running: curl http://localhost:3333/api/timeseries',
);
console.log(
'You can get all propertySetNames of an item by running: curl http://localhost:3333/api/timeseries/{assetId}',
);
console.log(
'You can get a specific time series data by running: curl http://localhost:3333/api/timeseries/{assetId}/{propertySetName}',
);
}
main();