ws4kp/server/scripts/modules/utils/weather.mjs

17 lines
344 B
JavaScript
Raw Normal View History

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}`);
} catch (e) {
console.log(`Unable to get point ${lat}, ${lon}`);
console.error(e);
return false;
}
};
export {
// eslint-disable-next-line import/prefer-default-export
getPoint,
};