The following function in Node.js, run well from my computer, bet return error when run from a web server. (I tried to add a host parameter, but it didn't solve the problem).
import axios from "axios";
export async function loadCities(_, res) {
const cities = await axios
.get(
`https://boardsgenerator.cbs.gov.il/Handlers/WebParts/YishuvimHandler.ashx?dataMode=Yeshuv&filters={"Years":"2021"}&language=Hebrew&mode=GridData&pageNumber=-1`
)
.catch((err) => {res.send(err)});
res.send({ cities});
}
The error message:
{
"message": "connect ETIMEDOUT 147.237.248.213:443",
"name": "Error",
"stack": "Error: connect ETIMEDOUT 147.237.248.213:443\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16)",
"config": {
"transitional": {
"silentJSONParsing": true,
"forcedJSONParsing": true,
"clarifyTimeoutError": false
},
"transformRequest": [
null
],
"transformResponse": [
null
],
"timeout": 0,
"xsrfCookieName": "XSRF-TOKEN",
"xsrfHeaderName": "X-XSRF-TOKEN",
"maxContentLength": -1,
"maxBodyLength": -1,
"env": {},
"headers": {
"Accept": "application/json, text/plain, */*",
"User-Agent": "axios/0.27.2"
},
"method": "get",
"url": "https://boardsgenerator.cbs.gov.il/Handlers/WebParts/YishuvimHandler.ashx?dataMode=Yeshuv&filters={\"Years\":\"2021\"}&language=Hebrew&mode=GridData&pageNumber=-1"
},
"code": "ETIMEDOUT",
"status": null
}