Posted on Aug 20, 2025
Connecting your application to an API often means jumping between docs, writing boilerplate, and testing requests until they work.
With GitHub Copilot, you can skip a lot of the overhead and focus on the part that matters — making your app actually do something useful.
Write a function in JavaScript that calls the OpenWeatherMap API,
fetches the current temperature for a given city,
and returns it in Celsius.
Add error handling if the city is not found.
Update the function to use async/await instead of promises.
Return the response as a formatted string, not just JSON.