fixed celestial calculations
This commit is contained in:
1976
server/package-lock.json
generated
1976
server/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,16 @@
|
||||
{
|
||||
"name": "weather-station",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"main": "index.mjs",
|
||||
"dependencies": {
|
||||
"@influxdata/influxdb-client": "^1.33.2",
|
||||
"@scalar/express-api-reference": "^0.10.4",
|
||||
"dotenv": "^16.3.1",
|
||||
"express": "^4.18.2",
|
||||
"yaml": "^2.9.0"
|
||||
}
|
||||
"name": "weather-station",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"main": "index.mjs",
|
||||
"scripts": {
|
||||
"start": "node server.mjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"@influxdata/influxdb-client": "^1.33.2",
|
||||
"@scalar/express-api-reference": "^0.10.4",
|
||||
"dotenv": "^16.3.1",
|
||||
"express": "^4.18.2",
|
||||
"yaml": "^2.9.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,8 @@ function filterArr(arr, fields) {
|
||||
|
||||
app.get('/api/current', async (req, res) => {
|
||||
const {fields} = req.query;
|
||||
const [sensors, space] = await Promise.all([queryCurrent(), getCelestialCurrent()]);
|
||||
const [sensors, coords] = await Promise.all([queryCurrent(), getCoords()]);
|
||||
const space = getCelestialCurrent(coords.latitude, coords.longitude);
|
||||
res.json(filterFields({...sensors, ...space}, fields));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user