fixed celestial calculations
This commit is contained in:
4
server/package-lock.json
generated
4
server/package-lock.json
generated
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "weather-station-api",
|
"name": "weather-station",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "weather-station-api",
|
"name": "weather-station",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@influxdata/influxdb-client": "^1.33.2",
|
"@influxdata/influxdb-client": "^1.33.2",
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "index.mjs",
|
"main": "index.mjs",
|
||||||
|
"scripts": {
|
||||||
|
"start": "node server.mjs"
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@influxdata/influxdb-client": "^1.33.2",
|
"@influxdata/influxdb-client": "^1.33.2",
|
||||||
"@scalar/express-api-reference": "^0.10.4",
|
"@scalar/express-api-reference": "^0.10.4",
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ function filterArr(arr, fields) {
|
|||||||
|
|
||||||
app.get('/api/current', async (req, res) => {
|
app.get('/api/current', async (req, res) => {
|
||||||
const {fields} = req.query;
|
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));
|
res.json(filterFields({...sensors, ...space}, fields));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user