chore(api): improved fetching data from api; changed to new vehicles data endpoint

This commit is contained in:
2026-04-05 01:28:23 +02:00
parent cd22a23aef
commit cd8c29f327
8 changed files with 103 additions and 31 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ async function main() {
if (!existsSync('endpoints')) await mkdir('endpoints');
Promise.all(
['getActiveData', 'getDonators', 'getSceneries', 'getVehicles'].map((endpointName) =>
['getActiveData', 'getDonators', 'getSceneries', 'getVehiclesData'].map((endpointName) =>
fetchJSONEndpointData(
`https://stacjownik.spythere.eu/api/${endpointName}`,
`${endpointName}.json`
+2 -2
View File
@@ -15,8 +15,8 @@ app.get('/api/getSceneries', (_, res) => {
res.sendFile(path.join(cwd(), 'endpoints', 'getSceneries.json'));
});
app.get('/api/getVehicles', (_, res) => {
res.sendFile(path.join(cwd(), 'endpoints', 'getVehicles.json'));
app.get('/api/getVehiclesData', (_, res) => {
res.sendFile(path.join(cwd(), 'endpoints', 'getVehiclesData.json'));
});
app.get('/api/getDonators', (_, res) => {