pre-load wfo point info for regional and travel cities

This commit is contained in:
Matt Walsh
2022-11-22 14:17:04 -06:00
parent 6e2abf6720
commit c28608bb39
13 changed files with 2940 additions and 11 deletions

View File

@@ -8,17 +8,17 @@ module.exports = (url) => new Promise((resolve, reject) => {
https.get(url, {
headers,
}, res => {
}, (res) => {
if (res.statusCode === 200) {
const buffers = [];
res.on('data', data => buffers.push(data));
res.on('data', (data) => buffers.push(data));
res.on('end', () => resolve(Buffer.concat(buffers).toString()));
} else {
console.log(res);
reject(new Error(`Unable to get: ${url}`));
}
}).on('error', e=> {
}).on('error', (e) => {
console.log(e);
reject(e);
});
});
});