Fixed paths
This commit is contained in:
@@ -11,6 +11,7 @@ import {existsSync} from 'fs';
|
||||
import {getAirTraffic, getAirTrafficHistory, getShapes} from './airtraffic.mjs';
|
||||
import {getWeatherCondition} from './openweather.mjs';
|
||||
import {ensureForecast, refreshForecast} from './forecast.mjs';
|
||||
import {dailyWeather, hourlyWeather} from './openmeteo.mjs';
|
||||
|
||||
const app = express();
|
||||
const DIR = dirname(fileURLToPath(import.meta.url));
|
||||
@@ -90,7 +91,7 @@ app.get('/api/hourly', async (req, res) => {
|
||||
// +24h → beyond: Open-Meteo
|
||||
let meteo = []
|
||||
if (end > plus24) {
|
||||
const [meteoResult] = await Promise.allSettled([getOpenMeteoHourly(coords.latitude, coords.longitude, plus24, end)])
|
||||
const [meteoResult] = await Promise.allSettled([hourlyWeather(coords.latitude, coords.longitude, plus24, end)])
|
||||
meteo = meteoResult.status === 'fulfilled' ? meteoResult.value : []
|
||||
}
|
||||
|
||||
@@ -124,7 +125,7 @@ app.get('/api/daily', async (req, res) => {
|
||||
// Future meteo (days after today)
|
||||
const meteoStart = end > next ? next : null
|
||||
const [meteoResult] = await Promise.allSettled([
|
||||
meteoStart && end > next ? getOpenMeteo(coords.latitude, coords.longitude, next, end) : Promise.resolve([])
|
||||
meteoStart && end > next ? dailyWeather(coords.latitude, coords.longitude, next, end) : Promise.resolve([])
|
||||
])
|
||||
const meteo = meteoResult.status === 'fulfilled' ? meteoResult.value : []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user