Calculate label + icon ourself
This commit is contained in:
@@ -10,6 +10,7 @@ import {apiReference} from '@scalar/express-api-reference';
|
||||
import {spec} from './spec.mjs';
|
||||
import {existsSync} from 'fs';
|
||||
import {getAirTraffic, getAirTrafficHistory, getShapes} from './airtraffic.mjs';
|
||||
import {getWeatherCondition} from './openweather.mjs';
|
||||
|
||||
const app = express();
|
||||
const DIR = dirname(fileURLToPath(import.meta.url));
|
||||
@@ -39,8 +40,9 @@ function filterArr(arr, fields) {
|
||||
app.get('/api/current', async (req, res) => {
|
||||
const {fields} = req.query;
|
||||
const [sensors, coords] = await Promise.all([queryCurrent(), getCoords()]);
|
||||
const condition = getWeatherCondition(sensors);
|
||||
const space = getCelestialCurrent(coords.latitude, coords.longitude);
|
||||
res.json(filterFields({...sensors, ...space}, fields));
|
||||
res.json(filterFields({...condition, ...sensors, ...space}, fields));
|
||||
});
|
||||
|
||||
// ── Position ──────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user