soundbirder/controllers/region.js

17 lines
363 B
JavaScript
Executable File

require("dotenv").config();
const debug = require("debug")("soundbirder:api:region");
const cache = require("./cache");
const axios = require("axios");
const { lookUp } = require("geojson-places");
async function getRegion(lat, lon) {
const result = lookUp(lat, lon);
const region = result.country_a2;
return region;
}
module.exports = {
getRegion,
};