Cleanup
This commit is contained in:
@@ -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 ────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user