const weather_to_drink_temp_map = { '0': "正常冰", '1': "正常冰", '2': "少冰", '3': "少冰", '71': "熱", '73': "熱", '75': "熱", '77': "熱", '95': "熱", '96': "熱", '99': "熱", } function 要冰(天氣) { if (weather_to_drink_temp_map[天氣]) return weather_to_drink_temp_map[天氣]; else return "溫"; } const BASE_URL = "https://api.open-meteo.com/v1/forecast?current_weather=true&" Deno.serve(async (req) => { const url = new URL(req.url); const latitude = "latitude=25.0330" const longitude = "longitude=121.5654" const 天氣 = await (await fetch(BASE_URL + latitude + "&" + longitude)).json() console.log(天氣) let resp = "not found" resp = 要冰(天氣); return new Response(resp); });