mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-14 23:59:30 -07:00
pre-load wfo point info for regional and travel cities
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user