This commit is contained in:
2026-06-26 00:05:28 -04:00
parent 9b7b7f49a7
commit 1ee386949c
11 changed files with 521 additions and 326 deletions

View File

@@ -56,20 +56,11 @@ app.get('/api/current', async (req, res) => {
const space = getCelestialCurrent(coords.latitude, coords.longitude)
const condition = getWeatherCondition(Object.assign(sensors, space))
const forecast = await getForecast();
const merged = {
...(forecast?.summary ? {
precipitation_chance: forecast.summary.precipitation_chance,
temperature_max: forecast.summary.temperature_max,
temperature_min: forecast.summary.temperature_min,
uv_index_max: forecast.summary.uv_index,
} : {}),
res.json(filterFields({
...condition,
...sensors,
...space,
}
res.json(filterFields(merged, fields))
}, fields))
})
// ── Hourly ────────────────────────────────────────────────────────────────────
@@ -148,10 +139,10 @@ app.get('/api/position', async (req, res) => {
// ── Space ─────────────────────────────────────────────────────────────────────
// app.get('/api/aurora', async (req, res) => res.json(await Aurora.get()));
app.get('/api/space', async (req, res) => {
const {fields} = req.query;
res.json(filterFields(await getSpaceWeather(), fields));
});
// app.get('/api/space', async (req, res) => {
// const {fields} = req.query;
// res.json(filterFields(await getSpaceWeather(), fields));
// });
// ── ADSB Proxy ────────────────────────────────────────────────────────────────