getaddress: send User-Agent to Nominatim
This commit is contained in:
Vendored
+7
-5
@@ -30,7 +30,10 @@
|
||||
],
|
||||
"program": "${workspaceFolder}/bin/www.js",
|
||||
"env": {
|
||||
"MONGOUSRP": "rexfue:noise4mongo",
|
||||
"MONGOUSRP": "admin:mongo4noise",
|
||||
"MONGOPORT": "27037",
|
||||
"MONGOHOST": "217.72.203.152",
|
||||
//"MONGOUSRP": "rexfue:5g2h4j3XC$$C$§442dcdsvDCx",
|
||||
"MONGOAUTH": "true",
|
||||
"INFLUXTOKEN": "q35XUBaElzcy8dDd9HF2_mpeHvYCampZg_9mJNP5jeBQRopq3EWIzNTZ555QLSIXhZC05RXCoFgjiaT7VzyNkQ==",
|
||||
"DEVELOP": "true",
|
||||
@@ -39,16 +42,15 @@
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Launch strato",
|
||||
"name": "Ralf",
|
||||
"skipFiles": [
|
||||
"<node_internals>/**"
|
||||
],
|
||||
"program": "${workspaceFolder}/bin/www.js",
|
||||
"env": {
|
||||
"MONGOHOST": "h3006374.stratoserver.net",
|
||||
"MONGOPORT": "27097",
|
||||
"MONGOHOST": "192.168.51.22",
|
||||
"MONGOAUTH": "true",
|
||||
"MONGOUSRP": "rxf:Tux4rxf"
|
||||
"MONGOUSRP": "rexfue:s25BMmW2gg",
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -33,7 +33,11 @@ export const getAddress = async (params) => {
|
||||
let coord = props.location[0].loc.coordinates
|
||||
let url = NOMINATIM_URL.replace('xx', coord[1]).replace('yy', coord[0])
|
||||
try {
|
||||
const response = await axios(encodeURI(url));
|
||||
const response = await axios(encodeURI(url),{
|
||||
headers: {
|
||||
'User-Agent': 'Firefox 132.0.1'
|
||||
}
|
||||
});
|
||||
if (response.status !== 200) {
|
||||
return returnOnError(ret, 'RESPSTATUS', getAddress.name, response.status)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import i18next from 'i18next'
|
||||
import i18nextMiddleware from 'i18next-http-middleware'
|
||||
import Backend from 'i18next-node-fs-backend'
|
||||
import {logit} from "./utilities/logit.js"
|
||||
import pkg from './package.json' assert { type: "json" }
|
||||
import pkg from './package.json' with { type: "json" }
|
||||
|
||||
|
||||
const app = express()
|
||||
|
||||
+15
-2
@@ -159,14 +159,19 @@ export const fetchActData = async (opts) => {
|
||||
ret.values = await client.db(MONGOBASE).collection('noise_sensors').aggregate([
|
||||
{$match: query},
|
||||
{$sort: { datetime: 1}},
|
||||
// {$replaceWith:
|
||||
// {
|
||||
// '$values.LA_min': '$values.noise_LA_min'
|
||||
// }
|
||||
// },
|
||||
{$replaceWith:
|
||||
{
|
||||
datetime: {$dateToString: {format: '%Y-%m-%dT%H:%M:%SZ', date: '$datetime'}},
|
||||
LA_min: '$values.LA_min',
|
||||
LA_minx: '$values.noise_LA_min',
|
||||
LA_max: '$values.LA_max',
|
||||
LAeq: '$values.LAeq',
|
||||
E10tel_eq: '$values.E10tel_eq'
|
||||
}
|
||||
E10tel_eq: '$values.E10tel_eq' }
|
||||
},
|
||||
// {$project: {
|
||||
// datetime: {$dateToString: {format: '%Y-%m-%dT%H:%M:%SZ', date: '$datetime'}},
|
||||
@@ -182,6 +187,14 @@ export const fetchActData = async (opts) => {
|
||||
}
|
||||
return ret
|
||||
}
|
||||
/*
|
||||
Try to connect to mongodb://rexfue:s25BMmW2gg@192.168.51.22:27017
|
||||
Try to connect to mongodb://rexfue:s25BMmW2gg@192.168.51.22:27017
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
let docs = await collection.find(
|
||||
{ datetime:
|
||||
|
||||
Reference in New Issue
Block a user