import _config from "../../configs/city.json" import * as process from "node:process"; export default async function handler(req, res) { const targetedCity = await fetch(process.env.CONFIG_URL as string) as unknown as typeof _config const getWeatherData = await fetch( `https://api.openweathermap.org/data/2.5/weather?q=${targetedCity.cityName}&units=metric&appid=${process.env.OPENWEATHER_API_KEY}` ); const data = await getWeatherData.json(); res.status(200).json(data); }