2022-12-06 22:14:56 +00:00
|
|
|
import { json } from './fetch.mjs';
|
|
|
|
|
|
|
|
const getPoint = async (lat, lon) => {
|
|
|
|
try {
|
|
|
|
return await json(`https://api.weather.gov/points/${lat},${lon}`);
|
2023-01-06 20:39:39 +00:00
|
|
|
} catch (error) {
|
2022-12-06 22:14:56 +00:00
|
|
|
console.log(`Unable to get point ${lat}, ${lon}`);
|
2023-01-06 20:39:39 +00:00
|
|
|
console.error(error);
|
2022-12-06 22:14:56 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export {
|
|
|
|
// eslint-disable-next-line import/prefer-default-export
|
|
|
|
getPoint,
|
|
|
|
};
|